JDBC Driver for Amazon S3

Build 26.0.9770

UploadObject

Uploads a new object to a bucket in a single operation, including optional metadata and storage class settings.

Stored Procedure-Specific Information

This procedure is the supported way to add objects to Amazon S3, because the Objects view does not support INSERT. You can provide the object data in one of four ways:
  • As a raw content stream in the Content input, in which case FileName is required to name the object.
  • As a single local file, by setting LocalFilePath to the file's path.
  • As every file in a local folder, by setting FolderPath to the folder's path. Each file is uploaded as a separate object.
  • As multiple files with per-file settings via ObjectInformationAggregate, supplying one row per file with LocalFilePath and optional Access columns, as a JSON array, XML document, or temporary table.

The CData JDBC Driver for Amazon S3 uploads large objects in parts. Set ChunkSize to control the part size in MB; the value must be at least five MB to satisfy the Amazon S3 multipart requirement. Set the Access input to apply a canned ACL, such as private or public-read, to the uploaded object.

The following example uploads a single file:

EXECUTE UploadObject
     @Bucket='BucketName',
     @LocalFilePath='C:/Users/User/Desktop/report.csv'

ObjectInformationAggregate accepts one row per file to upload, with LocalFilePath and optional Access columns, in any of three formats: a JSON array, an XML document, or a #TEMP table. When set, it takes precedence over the top-level LocalFilePath, Access, and Content inputs.

As a JSON array:

EXECUTE UploadObject
     @Bucket='BucketName',
     @ObjectInformationAggregate='[{"LocalFilePath":"C:/Users/User/file1.txt","Access":"PRIVATE"},{"LocalFilePath":"C:/Users/User/file2.txt","Access":"PUBLICREAD"}]'

As an XML document:

EXECUTE UploadObject
     @Bucket='BucketName',
     @ObjectInformationAggregate='<ObjectInformationAggregate><Row><LocalFilePath>C:/Users/User/file1.txt</LocalFilePath><Access>PRIVATE</Access></Row><Row><LocalFilePath>C:/Users/User/file2.txt</LocalFilePath><Access>PUBLICREAD</Access></Row></ObjectInformationAggregate>'

As a #TEMP table:

INSERT INTO ObjectInformationAggregate#TEMP (LocalFilePath, Access) VALUES ('C:/Users/User/file1.txt', 'PRIVATE')
INSERT INTO ObjectInformationAggregate#TEMP (LocalFilePath, Access) VALUES ('C:/Users/User/file2.txt', 'PUBLICREAD')
EXECUTE UploadObject
     @Bucket='BucketName',
     @ObjectInformationAggregate='ObjectInformationAggregate#TEMP'

The #TEMP table must be populated on the same connection used to call UploadObject, since temporary tables only last as long as the connection remains open.

Input

Name Type Required Accepts Input Streams Description
Bucket String True False The name of the S3 bucket where the object is uploaded.
FolderPath String False False The path to the folder that receives the data of the object.
ChunkSize Integer False False The part size (in MB) for multi-part uploads. If not specified, uses the SimpleUploadLimit connection property (in bytes) if set, otherwise defaults to 10 MB. Minimum is 5 MB.
LocalFilePath String False False The local file path of the object to upload. If a folder path is provided, all files in the folder are uploaded to the bucket. May also be supplied per row inside ObjectInformationAggregate.
Access String False False The access control setting (ACL) applied to the uploaded object, such as private, public-read, or authenticated-read. May also be supplied per row inside ObjectInformationAggregate.

The default value is PRIVATE.

ObjectInformationAggregate String False False A set of objects to upload, one row per file, with LocalFilePath and Access columns, supplied as a JSON array, an XML document, or the name of a #TEMP table. When set, it takes precedence over the top-level LocalFilePath, Access, and Content inputs.
Content String False True The raw content stream to upload when LocalFilePath or FolderPath is not specified.
FileName String False False The file name to assign to the uploaded object in S3. Required when providing content directly instead of a file path.
ETag String False False An optional entity tag (ETag) for conditional writes. When provided, the upload is performed only if the current ETag of the object matches this value, preventing accidental overwrites from concurrent modifications. If the values do not match, the request fails with a 412 Precondition Failed error.

Result Set Columns

Name Type Description
Status String Indicates the result of the upload operation, such as success or failure.

Copyright (c) 2026 CData Software, Inc. - All rights reserved.
Build 26.0.9770