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
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;