Closed rufman closed 9 years ago
Like metadataMap, manualContentEncoding allows you to set the Content-Encoding header using some arbitrary logic in a function:
metadataMap
manualContentEncoding
Content-Encoding
gulp.task("upload", function() { gulp.src("./dir/to/upload/**") .pipe(s3({ Bucket: 'example-bucket', ACL: 'public-read', manualContentEncoding: function(keyname) { var contentEncoding = null; if (keyname.indexOf('.gz') !== -1) { contentEncoding = 'gzip'; } return contentEncoding; } })); });
This is useful for when S3's auto content encoding detection won't work for you (like when you need to support gzipped files on older browsers where the extension needs to be .gz.js and not .js.gz).
.gz.js
.js.gz
Thanks for this, and modeling it after metadataMap!
Like
metadataMap
,manualContentEncoding
allows you to set theContent-Encoding
header using some arbitrary logic in a function:This is useful for when S3's auto content encoding detection won't work for you (like when you need to support gzipped files on older browsers where the extension needs to be
.gz.js
and not.js.gz
).