TTMSFNCCloudStorageServices and file tranfert position

Good morning to all,
during file upload to dropbox there's a way to get the actual bytes transfered ?
I can get it with "reverse" calculation" in TTMSFNCCloudStorageServices.Storage.OnRequestProgress
because here i have AProgress: Single and i have the total filesize (and now i'm using it); But i have even const ARequestResult: TTMSFNCCloudBaseRequestResult where there are

property ResultBytesReceived: Int64 
property ResultTotalBytes: Int64 
property ResultFileSize: Int64 

who i can't use in the event property OnProgress: TTMSFNCCloudBaseRequestProgressEvent because the result are (always)

 ResultBytesReceived=0 
 ResultTotalBytes=0 
 ResultFileSize=-1

As a request (mybe new) there is the possibility to show the remain upload time?
If not, can you give me some help on how calcutate it?

Thank's for all

Regards
Daniele

Hi,Preformatted text

the Result* properties are for download only. It's currently not possible to retrieve the remaining upload time, because this differs from service to service, internet connection, etc... The upload progress in percentage is currently the only viable solution. You could calculate your own estimate in seconds with the following code:

procedure TForm1.DoRequestProgress(Sender: TObject;
  const ARequestResult: TTMSFNCCloudBaseRequestResult; AProgress: Single;
  AUpload: Boolean);
var
  CheckTickCount, te: Cardinal;
  fs, tb: Int64;
  us, t: Double;
begin
  if AUpload then
  begin
    CheckTickCount := GetTickCount;
    te := CheckTickCount - FPreviousTickCount;
    tb := CloudStorage.Storage.GetUploadFileSize(ARequestResult);
    fs := Round(tb * AProgress / 100);
    us := fs / (te / 1000);
    t := (tb - fs) / us;

    TTMSFNCUtils.Log(Format('Speed: %n Kbps, Time remaining: %n seconds',[us / 1024, t]));
  end;
end;

And preset the time with:

CloudStorage.Upload(di, 'MyFile');
FPreviousTickCount := GetTickCount;

Hi Pieter,
thank's for your, appreciate, help ...

Have a good Easter

Regards
Daniele

1 Like

Thank you and the same for you!