Create Signed S3 URL with NodeJS & Knox - with headers

1.8k Views Asked by At

I am trying to create a signed s3 url using NodeJS and Knox.

var knox = require('knox');
var s3Client = knox.createClient({
    key: 'XXX',
    secret: 'XXX',
    bucket: 'XXX'
});
var expires = new Date();
expires.setMinutes(expires.getMinutes() + 30);
var url =  s3Client.signedUrl(filename, expires);

This produces a working signed URL which is great, but I need to add the response-content-disposition header to force downloads.

Does anyone know how this could be achieved with Knox or any other NodeJS S3 plugin?

0

There are 0 best solutions below