TMSFNCCloudStorageServices upload event and progress

Good afternoon,
i'm working with TMSFNCCloudStorageServices and i try to understand all the works you made in your demo UCloudStorageService.Pas

About the upload procedure, in the demo there's this code

procedure TForm4.TMSFNCCloudStorageServices1UploadFile(Sender: TObject;
  const AUploadItem: TTMSFNCCloudItem;
  const ARequestResult: TTMSFNCCloudBaseRequestResult);
begin
  TMSFNCCloudStorageServices1.GetFolderList;
end;

I suppose this event is called when the upload is finished, is this true?? (i think yes bucause the only call is to refresh the component item's list ....)

In this case, according with the demo, how is possibile monitoring the progress of the upoad?.

Somthing more ...

In the procedure there's

ARequestResult: TTMSFNCCloudBaseRequestResult

How it's possible handle this constant in order to set "cancel" and/or "read ResultBytesReceived" ?

In order to complete the component (TMSFNCCloudStorageServices) could be a good thing insert a "Rename" procedure (due the fact there are upload, copy and delete ....)

Last question:
All the job is asynchronous in order to avoid waiting long time operation.
Somtime, this is my need, is need to wait a while until one operation is done (i.e. filelist).
There's' a way to "swith" to synchronous.

Thenk's for your help

Regards
Daniele

Hi,

You can use the OnRequestProgress event to monitor upload progress.
Unfortunately upload canceling is currently not supported due to technical limitations.

Adding rename functionality is a good suggestion, we'll consider adding this feature in a future version.

Thank's for reply Bart.
One more question, there's a way to check if TTMSFNCCloudStorageServices is connected ?
At the moment i'm using a variable that is set to true in onconnect event, but if the connection drop this variable still be "true".
Where i have to check ??

Thank's for reply

Regards
Daniele

Hi,

You can periodically check with the following code

uses
  FMX.TMSFNCCloudBase, FMX.TMSFNCUtils;

procedure TForm1.CheckTokens;
begin
  TMSFNCCloudStorageServices1.Storage.TestTokens(
  procedure (const ARequestResult: TTMSFNCCloudBaseRequestResult)
  begin
    if TMSFNCCloudStorageServices1.Storage.GetTestTokensResult(ARequestResult) then
      TTMSFNCUtils.Log('Connected')
    else
    begin
      TTMSFNCUtils.Log('Not Connected');
    end;
  end
  )
end;

Thank's Pieter..