AWS.S3.TS3MultipartUploader.Upload

Upload a stream in parts to an object in an S3 bucket.

function Upload(const AContent: TStream; ABucket: string; AKey: string; AUseTempFiles: Boolean = False; AOnProgress: TS3UploadPartBatchProgressCallback = nil): Boolean;
__fastcall Boolean Upload(const TStream AContent, AnsiString ABucket, AnsiString AKey, Boolean AUseTempFiles = False, TS3UploadPartBatchProgressCallback AOnProgress = null);

File: AWS.S3.pas 

Namespace: AWS.S3 

Module: Appercept AWS SDK for Delphi 

Parameters
Description
ABucket: string
The name of a bucket to upload to.
AKey: string
An object key to use for the uploaded data.
AUseTempFiles: Boolean = False
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: TS3UploadPartBatchProgressCallback = nil
A callback providing progress updates.
AStream
A stream containing the part's content to upload.

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

// 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 );
Copyright © 2019-2021 Appercept Ltd. All rights reserved.