Skip to main content

Get object download link

Get presigned link for object retrieving without authorization

Function GetObjectDownloadLink(Val Name, Val Bucket, Val BasicData, Val Expire = 3600, Val Headers = Undefined, Val Directory = False) Export

ParameterCLI optionTypeRequiredDescription
Name--nameStringName of the object in the bucket
Bucket--bucketStringName of the bucket to put the object
BasicData--basicStructure Of KeyAndValueBasic request data. See GetBasicDataStructure
Expire--expiresString, NumberLink lifetime in seconds. 604800 max.
Headers--headersMap Of KeyAndValueAdditional request headers, if necessary
Directory--dirBooleanTrue > 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       = "s3.openintegrations.dev";
AccessKey = "bayselo...";
SecretKey = "12we34...";
Region = "BTC";

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

Name = "picture.jpg";

Directory = True; // Formation URL in path-style
Bucket = "w567hjy1";
Result = OPI_S3.GetObjectDownloadLink(Name, Bucket, BasicData, 7200, , Directory);
    # JSON data can also be passed as a path to a .json file

oint s3 GetObjectDownloadLink \
--name "picture.jpg" \
--bucket "b1a7b6e9" \
--basic "{'URL':'s3.openintegrations.dev','AccessKey':'***','SecretKey':'***','Region':'BTC','Service':'s3'}" \
--expires 7200 \
--dir true
Result
"s3.openintegrations.dev/0f78b405/picture.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=bayselonarrend%2F20260325%2FBTC%2Fs3%2Faws4_request&X-Amz-Date=20260325T093227Z&X-Amz-Expires=7200&X-Amz-SignedHeaders=host&X-Amz-Signature=5b1527a89a22718be8acd991de864b5ce0dd7bd8bdd6489a08bdd1aa0b7a68e3"