Get object upload link
Gets a direct link to upload (put) an object without additional authorization
Function GetObjectUploadLink(Val Name, Val Bucket, Val BasicData, Val Expire = 3600, 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 |
Expire | --expires | String, Number | ✖ | Link lifetime in seconds. 604800 max. |
Headers | --headers | Map Of KeyAndValue | ✖ | Additional request headers, if necessary |
Directory | --dir | Boolean | ✖ | True > Path style URL, False > Virtual hosted style URL |
Returns: String - URL for object retrieving
tip
In Headers you need to add all x-amz headers that will be used when accessing the received URL
Process at AWS documentation: Download and upload objects with presigned URLs
1C:Enterprise/OneScript code example
URL = "storage-155.s3hoster.by";
AccessKey = "BRN5RKJE67...";
SecretKey = "NNhv+i9PrytpT8Tu0C1N...";
Region = "BTC";
BasicData = OPI_S3.GetBasicDataStructure(URL, AccessKey, SecretKey, Region);
Name = "pictureU.jpg";
Directory = True; // Formation URL in path-style
Bucket = "newbucket2";
Result = OPI_S3.GetObjectUploadLink(Name, Bucket, BasicData, 7200, , Directory);
- Bash
- CMD/Bat
oint s3 GetObjectUploadLink \
--name "pictureU.jpg" \
--bucket "newbucket2" \
--basic "{'URL':'storage-155.s3hoster.by','AccessKey':'***','SecretKey':'***','Region':'BTC','Service':'s3'}" \
--expires 7200 \
--dir true
oint s3 GetObjectUploadLink ^
--name "pictureU.jpg" ^
--bucket "newbucket2" ^
--basic "{'URL':'storage-155.s3hoster.by','AccessKey':'***','SecretKey':'***','Region':'BTC','Service':'s3'}" ^
--expires 7200 ^
--dir true
Result
"storage-155.s3hoster.by/newbucket2/pictureU.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=BRN5RKJE67YCVDZRRQVI%2F20250915%2FBTC%2Fs3%2Faws4_request&X-Amz-Date=20250915T231846Z&X-Amz-Expires=7200&X-Amz-SignedHeaders=host&X-Amz-Signature=335606fa3e07f274139b3067ced25616f007ef78edb5b835108e29191f81b93a"