IS3MultipartUploader
Interface in AWS.S3
Interface for a multipart uploader.
Properties
PartSize
property PartSize: Int64
The part size in Bytes to split the content into.
Methods
Upload
function Upload(const AContent: TStream; ABucket, AKey: string; AUseTempFiles: Boolean = False; AOnProgress: TS3UploadPartBatchProgressCallback = nil): Boolean;
Upload a stream in parts to an object in an S3 bucket.
// Create or load a stream of data to upload. var LStream := TMemoryStream.Create; var S3 := TS3Client.Create; var LUploader := TS3MultipartUploader.Create(S3) as IS3MultipartUploader; // Upload in 10 MegaByte parts. LUploader.PartSize := 10 * 1024 * 1024; LUploader.Upload( LStream, '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 |
|---|---|
AStream | A stream containing the part's content to upload. |
ABucket | The name of a bucket to upload to. |
AKey | An object key to use for the uploaded data. |
AUseTempFiles | Specifies whether temporary files should be used when performing multipart uploads. Using temporary files can reduce memory pressure when performing large uploads at the cost of storage space and disk I/O. |
AOnProgress | A callback providing progress updates. |
Returns
A Boolean value indicating success () or failure () of the upload.