Closed manikmi closed 8 years ago
@manikmi - Thanks for your feedback. I've added this feature.
You can now set any available params to the S3 object. I believe you were referring to the "CacheControl" options, so an example might look like:
s3Params : { 'CacheControl' : 'max-age=3600'}
So if you look at the example here https://github.com/adamhenson/example-s3-image-uploader/blob/master/server.js - the options would look similar to the below:
uploader.upload({
fileId : size + '_' + options.imgId,
bucket : 'hensonism-test',
source : options.imgPath,
maxFileSize : 1,
name : size + '_' + options.imgName,
s3Params : { 'CacheControl' : 'max-age=3600'}
},
I was able to use similar code and confirmed it updated in AWS (see screenshot below).
I've committed the update and pushed to NPM.
Hi Adam, Thanks for the nice package. Can we have some option like to set the header for the file uploaded? I see there is something like that in s3 package, which you are using internally. I want to set the cache expiration for my file uploaded to S3.
Thanks, Manik Mittal