TdxCloudStorage.DownloadFile(string,TStream,TdxCloudStorageFileProgressCallback) Method
In This Article
Downloads a specified file to a stream.
#Declaration
Delphi
function DownloadFile(const AFileName: string; AStream: TStream; AProgressCallback: TdxCloudStorageFileProgressCallback = nil): Boolean; overload;
#Parameters
Name | Type | Description |
---|---|---|
AFile |
string | The absolute path to a file, starting from a cloud storage’s root. |
AStream | TStream | A stream object. |
AProgress |
Tdx |
A callback procedure that tracks 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 optional parameter to track file download progress. Refer to the TdxCloudStorageFileProgressCallback procedural type description for details.
Note
The Download
See Also