Skip to main content

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

NameDescription
AFilePathA path to a file to upload.
ABucketThe name of a bucket to upload to.
AKeyAn object key to use for the uploaded file.
AOnProgressA callback providing progress updates.

Returns

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