Maybe you have solved in the meanwhile, but since you are hosting the files on S3
(see comments on Peter B's answer), you need to add a signature to the files url and set the ResponseContentType
to binary/octet-stream
by using the aws sdk. I am using Node so it becomes:
const promises = array.map((item) => {
const promise = s3.getSignedUrlPromise('getObject', {
Bucket: process.env.S3_BUCKET,
Key: key, //filename
Expires: 604800, //time to expire in seconds (optional)
ResponseContentType: 'binary/octet-stream'
});
return promise;
});
const links = await Promise.all(promises);
I hope this helps.