Data.Cloud.AmazonAPI.TAmazonStorageService.UploadObject
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 |
---|---|
|
The name of the bucket the object is in. |
|
The name to use for the object being uploaded. |
|
The object's content, in bytes. |
|
The optional metadata to set on the object, or nil. |
|
Optional request headers to use. |
|
Optional ACL to apply to the object. If unspecified, it will default to private. |
|
The optional class for storing response info into. |
See Also
- System.Generics.Collections.TArray
- Data.Cloud.AmazonAPI.TAmazonACLType
- System.Byte
- Data.Cloud.AmazonAPI.TAmazonStorageService.GetObjectACLXML
- Data.Cloud.AmazonAPI.TAmazonStorageService.CopyObject
- Data.Cloud.AmazonAPI.TAmazonStorageService.GetObjectACL
- Data.Cloud.AmazonAPI.TAmazonStorageService.DeleteObject
- Introduction to Amazon S3 (amazonwebservices.com)