Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ req.file('avatar')
secret: 'AB2g1939eaGAdesoccertournament',
bucket: 'my_stuff',
// Optional
token: 'temporary_sts_creds'
token: 'temporary_sts_creds',
acl: 'public-read',
}, function whenDone(err, uploadedFiles) {
if (err) {
return res.serverError(err);
Expand Down
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ module.exports = function SkipperS3 (globalOpts) {
headers['content-type'] = mime.lookup(__newFile.fd);
}

// Add acl to the headers if it was set in the options.
if (options.hasOwnProperty('acl') && typeof options['acl'] === 'string'){
headers['x-amz-acl'] = options['acl'];
}

var bytesWritten = 0;

var mpu = new S3MultipartUpload({
Expand Down