I am using skipper-s3 to upload files. I find out that all files uploaded to S3 have been set to ACL:private
and Content-Type:binary/octet-stream
by default. I would like to know if it is possible to set these parameters before uploading to S3.
Maybe something like this:
req.file('image').upload({
adapter: require('skipper-s3'),
key: KEY,
secret: SECRET,
bucket: BUCKET_NAME,
headers: {
ContentType: 'image/png',
ACL: 'public-read'
}
}
I have read the issue, but there is still no answer. In addition, is there any way to get the Content-Type
of files sent from client?
UPDATE: The issue was closed. It seems like it is a knox-mpu issue.
Thanks to a pull request, this is now possible. If you don't specify a content-type
header, it will now be guessed based on the filename. Also note that you should use the headers specified by the S3 docs; for example, to do ACL you would set the x-amz-acl
to public-read
.