FNC Cloud get cloud available disk space

Hi to all,
in my project i use TTMSFNCCloudStorageServices in order to upload, download and delete files on cloud. Sometime happend that on cloud there is not available disk space to accept the upload file.
For example, for my dropbox account i have 2TB of total "disk space" and i used 1,9TB if the upload file is 200MB can't be upload.
So, if is possibible, before i send it to dropbox i'll check the avilable space and if is ok .... start the upload.

Thank you for attention

Regards
Daniele

Hi,

You can use the GetAccountInfo call from the active storage service to retrieve information about available storage space. The info is returned in the OnGetCurrentAccount event. The example below is for DropBox specifically, the way this data is returned is different depending which storage service is used.

procedure TForm1.TMSFNCCloudDropBox1GetCurrentAccount(Sender: TObject;
  const AInfo: TTMSFNCCloudDropBoxInfo;
  const ARequestResult: TTMSFNCCloudBaseRequestResult);
begin
  TTMSFNCUtils.Log('total space: ' + FloatToStr(AInfo.Quota));
  TTMSFNCUtils.Log('used space: ' + FloatToStr(AInfo.QuotaNormal));
end;
  TTMSFNCCloudDropBox(TMSFNCCloudStorageServices1.Storage).OnGetCurrentAccount := TMSFNCCloudDropBox1GetCurrentAccount;
  TTMSFNCCloudDropBox(TMSFNCCloudStorageServices1.Storage).GetAccountInfo;

I have had no luck uploading files >150MB to Dropbox using Upload(). This issue is not related to how much disk space is available in the Dropbox account.

Hi,

The regular Upload to DropBox is limited to 150MB. This is a service limitation. Please use UploadResumableFile instead.
The following blog post explains the usage of resumable uploads: