AWS.S3.TS3StreamUploader.Upload

Upload the contents of a stream to an object in an S3 bucket.

function Upload(const AStream: TStream; ABucket: string; AKey: string; AUseTempFiles: Boolean = False; AOnProgress: TS3UploadPartBatchProgressCallback = nil): Boolean;
__fastcall Boolean Upload(const TStream AStream, 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
const AStream: TStream
A stream containing the object's content to upload.
ABucket: string
The name of a bucket to upload to.
AKey: string
An object key to use for the uploaded file.
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.

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