IS3FileUploader
Interface in AWS.S3
Interface for a file uploader.
Properties
MultipartThreshold
property MultipartThreshold: Int64
Specifies the threshold size in Bytes at which a file will be uploaded in parts.
Methods
Upload
function Upload(const AFilePath, ABucket, AKey: string; AUseTempFiles: Boolean = False; AOnProgress: TS3UploadPartBatchProgressCallback = nil): Boolean;
Upload a file to an object in an S3 bucket.
var S3 := TS3Client.Create; var LUploader := TS3FileUploader.Create(S3) as IS3FileUploader; LUploader.Upload( '/path/to/file', 'a-destination-bucket', 'a-destination-key' False, procedure(const AUploadId: string; APartNumber: Integer; APartSize, APartWriteCount, AOverallSize, AOverallWriteCount: Int64; var AAbort: Boolean) begin // Update your user interface with current progress. end ); )
Parameters
| Name | Description |
|---|---|
AFilePath | A path to a file to upload. |
ABucket | The name of a bucket to upload to. |
AKey | An object key to use for the uploaded file. |
AOnProgress | A callback providing progress updates. |
Returns
A Boolean value indicating success () or failure () of the upload.