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

TdxCloudStorage.DownloadFile(TdxCloudStorageFile,TStream,TdxCloudStorageFileProgressCallback) Method

Downloads a specified file from the cloud storage to a stream.

#Declaration

Delphi
function DownloadFile(AFile: TdxCloudStorageFile; AStream: TStream; AProgressCallback: TdxCloudStorageFileProgressCallback = nil): Boolean; overload;

#Parameters

Name Type Description
AFile TdxCloudStorageFile

A cloud file metadata container that corresponds to the target file.

AStream TStream

A stream object.

AProgressCallback TdxCloudStorageFileProgressCallback

A callback procedure that tracks file download progress.

#Returns

Type Description
Boolean

True if the target file was downloaded successfully; otherwise, False.

#Remarks

The following code example downloads the Image.jpg file from the Images folder in a connected cloud storage.

var
  AStream: TMemoryStream;
//...
  AStream := TMemoryStream.Create;
  dxCloudStorage1.DownloadFile('/Images/Image.jpg', AStream);

You can also implement a callback procedure and pass it as the AProgressCallback parameter to track file download progress. Refer to the TdxCloudStorageFileProgressCallback procedural type description for details.

Note

The DownloadFile function always runs in the same thread from which it is called.

See Also