S3 temporary signed URL with custom header without changing object metadata to disk

I have a bucket with randomly named files and a ruby ​​script that generates a signed URL that expires in 2 days, but I need to add a header to post the content to correct the file name in the desired format.

abritently (with the primary key from the database) to prevent file name conflicts

Is it possible to change the url to add the content title without changing the title content-dispositionand save it in the bucket?

+3
source share
2 answers

url_for() AWS:: S3:: S3Object AWS SDK Ruby URL Amazon S3, options URL-, content-disposition:

: response_content_disposition (String) - Content-Disposition HTTP GET URL.

+2

- JavaScript:

s3.getSignedUrl(
  'getObject',
  {
    Bucket: 'foo',
    Key: 'bar',
    ResponseContentDisposition: 'attachment; filename="bar"'
  },
  (error, signedURL) => {
    console.log(signedURL);
  }
);
0

All Articles