8000 Add support for content disposition header by franciscotfmc · Pull Request #58 · anacronw/multer-s3 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support for content disposition header #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 4, 2016
Merged

Add support for content disposition header #58

merged 1 commit into from
Nov 4, 2016

Conversation

franciscotfmc
Copy link
Contributor

Added the contentDisposition option. I needed this in order to force browsers to download the uploaded file, considering that I'm using the AUTO_CONTENT_TYPE flag.

In other words, now it is possible to do this:

multerS3({
    s3: s3,
    bucket: 'bucket',
    contentType: multerS3.AUTO_CONTENT_TYPE,
    contentDisposition: 'attachment',
});

Passing the contentDisposition forward forces the behavior I needed, which is to always make the browser download the file instead of trying to open it.

I'm not sure if others might find this useful, but I hope to help someone anyway.
The changes don't break anything.

@anacronw
Copy link
Owner
anacronw commented Nov 3, 2016

lgtm @LinusU what do you think?

Copy link
Collaborator
@LinusU LinusU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👌

@anacronw anacronw merged commit d54808a into anacronw:master Nov 4, 2016
@anacronw
Copy link
Owner
anacronw commented Nov 4, 2016

Thanks

anacronw pushed a commit that referenced this pull request Nov 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0