Data.Cloud.AmazonAPI.TAmazonStorageService.UploadObject

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function UploadObject(const BucketName, ObjectName: string; Content: TArray<Byte>; ReducedRedundancy: Boolean = false;  Metadata: TStrings = nil; Headers: TStrings = nil; ACL: TAmazonACLType = amzbaPrivate; ResponseInfo: TCloudResponseInfo = nil; BucketRegion: TAmazonRegion = amzrNotSpecified): Boolean;

C++

bool __fastcall UploadObject(const System::UnicodeString BucketName, const System::UnicodeString ObjectName, System::DynamicArray<System::Byte> Content, bool ReducedRedundancy = false, System::Classes::TStrings* Metadata = (System::Classes::TStrings*)(0x0), System::Classes::TStrings* Headers = (System::Classes::TStrings*)(0x0), TAmazonACLType ACL = (TAmazonACLType)(0x1), Data::Cloud::Cloudapi::TCloudResponseInfo* ResponseInfo = (Data::Cloud::Cloudapi::TCloudResponseInfo*)(0x0), TAmazonRegion BucketRegion = (TAmazonRegion)(0x0));

Properties

Type Visibility Source Unit Parent
function public
Data.Cloud.AmazonAPI.pas
Data.Cloud.AmazonAPI.hpp
Data.Cloud.AmazonAPI TAmazonStorageService

Description

Uploads the given object, optionally setting metadata on it.

UploadObject uploads the given object, optionally setting metadata on it.

Several optional headers can be set to the request. To see a full list, view the Amazon API. Some include: Content-MD5, Content-Type, or x-amz-storage-class.

If you provide a ResponseInfo instance and versioning is enabled, then a successful request will result in an 'x-amz-version-id' header being populated, which is the uploaded object's version.

The method returns True if the request was successful, False otherwise.

The following table shows the significance of the parameters:

Parameter Description

BucketName

The name of the bucket the object is in.

ObjectName

The name to use for the object being uploaded.

Content

The object's content, in bytes.

Metadata

The optional metadata to set on the object, or nil.

Headers

Optional request headers to use.

ACL

Optional ACL to apply to the object. If unspecified, it will default to private.

ResponseInfo

The optional class for storing response info into.

See Also