Init parts upload
Initializes the multipart object uploading
- Parameters
- Advanced call ?
Function InitPartsUpload(Val Name, Val Bucket, Val BasicData, Val Headers = Undefined, Val Directory = False) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Name | --name | String | ✔ | Name of the object in the bucket |
| Bucket | --bucket | String | ✔ | Name of the bucket to put the object |
| BasicData | --basic | Structure Of KeyAndValue | ✔ | Basic request data. See GetBasicDataStructure |
| Headers | --headers | Map Of KeyAndValue | ✖ | Additional request headers, if necessary |
| Directory | --dir | Boolean | ✖ | True > Path style URL, False > Virtual hosted style URL |
Returns
Structure Of KeyAndValue - serialized JSON response from storage
| Parameter | Description |
|---|---|
| proxy | InternetProxy or a structure with fields Protocol, Host, Port, User, Password, UseOSAuthentication |
| timeout | Request execution timeout |
| adv_response | Formats the response as a complete HTTP structure with fields code, body, and headers |
| retries | Number of HTTP request send attempts on 5** status codes or internal client errors |
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
tip
Method at AWS documentation: CreateMultipartUpload
This is a service method. A PutObject method is intended for the common scenario of files uploading
Using multipart upload for files < 5 MB or when the size of a single chunk is < 5 MB will result in an error
1C:Enterprise/OneScript code example
URL = "s3.openintegrations.dev";
AccessKey = "bayselo...";
SecretKey = "12we34...";
Region = "BTC";
BasicData = OPI_S3.GetBasicDataStructure(URL, AccessKey, SecretKey, Region);
Name = "fileChunked.mp3";
Directory = True; // Formation URL in path-style
Bucket = "w567hjy1";
Entity = "https://hut.openintegrations.dev/test_data/song.mp3"; // URL, Path or Binary data
Entity = OPI_HTTPRequests.Get(Entity);
Result = OPI_S3.InitPartsUpload(Name, Bucket, BasicData, , Directory);
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UploadID = Result["response"]["InitiateMultipartUploadResult"]["UploadId"];
TotalSize = Entity.Size();
ChunkSize = 5242880;
BytesRead = 0;
PartNumber = 1;
DataReader = New DataReader(Entity);
SourceStream = DataReader.SourceStream();
TagsArray = New Array;
While BytesRead < TotalSize Do
CurrentReading = DataReader.Read(ChunkSize);
CurrentData = CurrentReading.GetBinaryData();
If CurrentData.Size() = 0 Then
Break;
EndIf;
Result = OPI_S3.UploadObjectPart(Name
, Bucket
, BasicData
, UploadID
, PartNumber
, CurrentData
, Directory);
BytesRead = SourceStream.CurrentPosition();
ETag = Result["headers"]["Etag"];
ETag = ?(ETag = Undefined, Result["headers"]["ETag"], ETag);
TagsArray.Add(ETag);
PartNumber = PartNumber + 1;
EndDo;
Result = OPI_S3.FinishPartsUpload(Name, Bucket, BasicData, UploadID, TagsArray, , Directory);
- Bash
- CMD/Bat
# JSON data can also be passed as a path to a .json file
oint s3 InitPartsUpload \
--name "fileChunked.mp3" \
--bucket "5540d93d" \
--basic "{'URL':'s3.openintegrations.dev','AccessKey':'***','SecretKey':'***','Region':'BTC','Service':'s3'}" \
--dir true
:: JSON data can also be passed as a path to a .json file
oint s3 InitPartsUpload ^
--name "fileChunked.mp3" ^
--bucket "5540d93d" ^
--basic "{'URL':'s3.openintegrations.dev','AccessKey':'***','SecretKey':'***','Region':'BTC','Service':'s3'}" ^
--dir true
Result
{
"status": 200,
"response": {
"InitiateMultipartUploadResult": {
"Bucket": "5540d93d",
"Key": "***",
"UploadId": "MGI2Y2U2YTAtMDYxZC00NzkwLTk3YmEtOTM0NDY2MWFjZGYwLjM4YTYxNGVlLTM2MjQtNDQ2OS1hOTBjLTlhNjg0MjMzOWEyOHgx..."
}
},
"headers": {
"Accept-Ranges": "bytes",
"Vary": "Accept-Encoding",
"Server": "Microsoft-IIS/10.0",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"X-Amz-Id-2": "dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8",
"X-Amz-Request-Id": "18B323C62653DCD1",
"X-Content-Type-Options": "nosniff",
"X-Ratelimit-Limit": "6518",
"X-Ratelimit-Remaining": "6518",
"X-XSS-Protection": "1; mode=block",
"X-Powered-By": "ARR/3.0",
"Date": "Tue, 26 May 2026 14:26:51 GMT",
"Content-Type": "application/xml",
"Content-Length": "346"
}
}