IS3StreamUploader
Interface in AWS.S3
Interface for a stream uploader.
Properties
MultipartThreshold
property MultipartThreshold: Int64
Specifies the threshold size in Bytes at which a stream will be uploaded in parts.
Methods
Upload
function Upload(const AStream: TStream; ABucket, AKey: string; AUseTempFiles: Boolean = False; AOnProgress: TS3UploadPartBatchProgressCallback = nil): Boolean;
Upload the contents of a stream 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 := TS3StreamUploader.Create(S3) as IS3StreamUploader; 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 object's content to upload. |
ABucket | The name of a bucket to upload to. |
AKey | An object key to use for the uploaded file. |
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.