Skip to main content

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

NameDescription
AStreamA stream containing the object's content to upload.
ABucketThe name of a bucket to upload to.
AKeyAn object key to use for the uploaded file.
AUseTempFilesSpecifies 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.
AOnProgressA callback providing progress updates.

Returns

A Boolean value indicating success () or failure () of the upload.