Skip to main content

TdxCloudStorage.TItemDownloadingEvent Type

The nested procedural type of the file download initiation event.

Declaration

TItemDownloadingEvent = procedure(Sender: TObject; const AItem: TdxCloudStorageItem; const ASize: Integer) of object;

Parameters

Name Type Description
Sender TObject

The cloud storage component that downloads a file.

AItem TdxCloudStorageItem

The resource metadata container that corresponds to a file downloaded from the connected server.

ASize Integer

The source file size (in bytes).

Remarks

The Sender parameter provides access to the cloud storage component that raised the file download initiation event. To access the cloud storage component’s class members within a TItemDownloadingEvent event handler, cast the parameter value to the TdxCloudStorage class.

The AItem parameter returns the cloud file metadata container corresponding to the file that the file download routine has started to copy from the connected online storage service’s server. Cast the AItem parameter value to the TdxCloudStorageFile class to access all class-specific members that file metadata containers have.

The ASize parameter returns the source file size (in bytes) if the server can provide it for this file type. If the source file is a document stored in a unique, service-specific format, such as a Google Sheets document, the parameter returns -1 instead of the file size. In most cases, online services provide unique docuemnt files in a requested data format. Refer to the cloud service-specific data provider descriptions for additional information.

If the ASize parameter returns a file size, you can use it to calculate the overall download progress within a TItemDownloadEvent event handler.

The OnItemDownloading event references the TItemDownloadingEvent nested procedural type.

See Also