AWS.S3.TS3Object.UploadFile

Uploads a file to the object.

function UploadFile(const AFilePath: string; AUseTempFiles: Boolean = False; AOnProgress: TS3UploadPartBatchProgressCallback = nil; AFileUploader: IS3FileUploader = nil): Boolean;
__fastcall Boolean UploadFile(const AnsiString AFilePath, Boolean AUseTempFiles = False, TS3UploadPartBatchProgressCallback AOnProgress = null, IS3FileUploader AFileUploader = null);

File: AWS.S3.pas 

Namespace: AWS.S3 

Module: Appercept AWS SDK for Delphi 

Parameters
Description
const AFilePath: string
The path of a file to upload.
AUseTempFiles: Boolean = False
Optional Boolean value indicating whether to use temp-files (True) or memory (False) for buffering parts. The use of temporary files reduces memory pressure when uploading large files.
AOnProgress: TS3UploadPartBatchProgressCallback = nil
An optional callback providing progress updates.
AFileUploader: IS3FileUploader = nil
An optional IS3FileUploader instance to handle the file upload.

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

var LObject := TS3Object.Create('my-bucket', 'my-object') as IS3Object; LObject.UploadFile( '/path/to/file', 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.