Skip to content

Commit

Permalink
add support aws-sdk/putObject parameter 'ContentDisposition'
Browse files Browse the repository at this point in the history
  • Loading branch information
agolybev committed Sep 3, 2015
1 parent e3a3c50 commit 3c61351
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ module.exports = function (rootDirectory, logger, indexDocument, errorDocument)
res.header('Last-Modified', new Date(object.modifiedDate).toUTCString());
res.header('Content-Type', object.contentType);

if (object.contentDisposition)
res.header('Content-Disposition', object.contentDisposition);
if (object.contentEncoding)
res.header('Content-Encoding', object.contentEncoding);

Expand Down
4 changes: 4 additions & 0 deletions lib/file-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ var FileStore = function (rootDirectory) {
key: key,
md5: json.md5,
contentType: json.contentType,
contentDisposition: json.contentDisposition,
contentEncoding: json.contentEncoding,
size: json.size,
modifiedDate: json.modifiedDate,
Expand All @@ -173,6 +174,7 @@ var FileStore = function (rootDirectory) {
var createMetaData = function (data, done) {
var contentFile = data.contentFile,
type = data.type,
disposition = data.disposition,
encoding = data.encoding,
metaFile = data.metaFile,
headers = data.headers;
Expand Down Expand Up @@ -200,6 +202,7 @@ var FileStore = function (rootDirectory) {
var metaData = {
md5: results[1].md5,
contentType: type,
contentDisposition: disposition,
size: results[1].size,
modifiedDate: results[0].mtime,
creationDate: results[0].ctime,
Expand Down Expand Up @@ -232,6 +235,7 @@ var FileStore = function (rootDirectory) {
createMetaData({
contentFile: contentFile,
type: req.headers['content-type'],
disposition: req.headers['content-disposition'],
encoding: req.headers['content-encoding'],
key: key,
metaFile: metaFile,
Expand Down
1 change: 1 addition & 0 deletions lib/models/s3-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var S3Object = function (s3Item) {
var item = {
key: s3Item.key,
contentType: s3Item.contentType,
contentDisposition: s3Item.contentDisposition,
contentEncoding: s3Item.contentEncoding,
md5: s3Item.md5,
size: s3Item.size,
Expand Down

0 comments on commit 3c61351

Please sign in to comment.