Skip to content
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

new options: fileName and isAttachment #444

Closed
wants to merge 1 commit into from

Conversation

tojocky
Copy link

@tojocky tojocky commented Dec 22, 2011

Hello,

I propose to add new options:

  • fileName - if want set other name than in url
  • isAttachment - if want to start auto download.

If option isAttachment is true then the attachment will auto start to download.
@tj
Copy link
Member

tj commented Dec 22, 2011

is this change intended to be used with the Express res.sendfile()? because you can use res.download().

@tj
Copy link
Member

tj commented Dec 22, 2011

either way I dont think this is a good fit because you can just do setHeader() before transferring the file

@tj tj closed this Dec 22, 2011
@tojocky
Copy link
Author

tojocky commented Dec 23, 2011

Ok,

Thank you for your hint.
res.sendfile() and res.download() is not exact what I expect. I want to change only filename wihout auto download.

@tj
Copy link
Member

tj commented Dec 23, 2011

well with a content-disposition of attachment most user-agents will prompt for the download, sendfile() is pretty much identical to static(), and res.download() builds on sendfile() with res.attachment()

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.

None yet

2 participants