Skip to main content

Copy object

Copies an object from one location to another

Function CopyObject(Val SourcePath, Val DestinationBucket, Val DestinationPath, Val SourceBucket, Val BasicData, Val Headers = Undefined, Val Directory = False) Export

ParameterCLI optionTypeRequiredDescription
SourcePath--snameStringPath (name) in the source bucket
DestinationBucket--sbucketStringSource bucket name
DestinationPath--nameStringPath (name) in the destination bucket
SourceBucket--bucketStringDestination bucket name
BasicData--basicStructure Of KeyAndValueBasic request data. See GetBasicDataStructure
Headers--headersMap Of KeyAndValueAdditional request headers, if necessary
Directory--dirBooleanTrue > Path style URL, False > Virtual hosted style URL

Returns: Structure Of KeyAndValue - serialized JSON response from storage

tip

Method at AWS documentation: CopyObject


1C:Enterprise/OneScript code example
    URL       = "s3.openintegrations.dev";
AccessKey = "bayselo...";
SecretKey = "12we34...";
Region = "BTC";

BasicData = OPI_S3.GetBasicDataStructure(URL, AccessKey, SecretKey, Region);

Directory = True; // Formation URL in path-style
SourcePath = "picture.jpg";
DestinationBucket = "newbucket2";

DestinationPath = "new_picture.jpg";
SourceBucket = "w567hjy1";
Result = OPI_S3.CopyObject(SourcePath, DestinationBucket, DestinationPath, SourceBucket, BasicData, , Directory);
    # JSON data can also be passed as a path to a .json file

oint s3 CopyObject \
--sname "picture.jpg" \
--sbucket "newbucket2" \
--name "new_picture.jpg" \
--bucket "b1a7b6e9" \
--basic "{'URL':'s3.openintegrations.dev','AccessKey':'***','SecretKey':'***','Region':'BTC','Service':'s3'}" \
--dir true
Result
{
"status": 200,
"response": {
"CopyObjectResult": {
"LastModified": "2026-03-25T09:28:40.264Z",
"ETag": "\"9e0176f87f6565a22f78e0f9b39a4d78\""
}
},
"headers": {
"Accept-Ranges": "bytes",
"ETag": "\"9e0176f87f6565a22f78e0f9b39a4d78\"",
"Vary": "Accept-Encoding",
"Server": "Microsoft-IIS/10.0",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"X-Amz-Checksum-Crc64nvme": "p+vCtK1YeeU=",
"X-Amz-Checksum-Type": "FULL_OBJECT",
"X-Amz-Id-2": "dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8",
"X-Amz-Request-Id": "18A00B85484EE735",
"X-Content-Type-Options": "nosniff",
"X-Ratelimit-Limit": "6432",
"X-Ratelimit-Remaining": "6432",
"X-XSS-Protection": "1; mode=block",
"X-Powered-By": "ARR/3.0",
"Date": "Wed, 25 Mar 2026 09:28:40 GMT",
"Content-Type": "application/xml",
"Content-Length": "232"
}
}