Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxCloudStorageFileProgressCallback Type

The callback procedural type designed to track file upload and download progress.

#Declaration

Delphi
TdxCloudStorageFileProgressCallback = reference to procedure(const APosition: Int64; const ASize: Int64);

#Parameters

Name Type Description
APosition Int64

Returns the number of downloaded or uploaded bytes.

ASize Int64

Returns the size of a downloaded or uploaded file, in bytes. The parameter returns -1 if the server cannot return the downloaded file’s size.

#Remarks

Implement a TdxCloudStorageFileProgressCallback procedure to track file upload or download progress. The following code example calculates download progress as a percentage you can display in your application UI:

 var
   AProgress: Integer; // File download progress as a percentage
//...
   if(ASize <> -1) then // If the server provides the file size
     AProgress := Round(APosition/ASize * 100);

The AProgressCallback parameter in the cloud storage component’s DownloadFile and UploadFile functions references the TdxCloudStorageFileProgressCallback procedural type.

See Also