-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Proposal: Download file #67
Comments
There is an example on how to recieve files from a request in the webpage. Although it would be nice as a separated module feature |
Hey @Nosthertus , can you give me a link to that example? |
Sure. You can see it in http://dietjs.com/tutorials/router#middleware
|
As far as I understand this shows how to upload file, what I'm looking for is a way for a user to download file when he opens a link, like when he opens a link lilke this |
I was thinking to make that feature for the module i made I have made an example about sending files to the client which could be helpful for you in this comment |
Thank you so much!! |
@ahmadibrahim-c |
As of // Register a route that downloads the /image.png as diet_logo.png
app.get('/', function($){
$.download('./image.png', 'diet_logo.png')
}) For reference check out the simple Download Example: |
@adamhalasz does this set any special headers to the response?, also.. does this have support for auto |
@Nosthertus Yes it sets the content-disposition header. Yes it does detect the mime type since it is using $.sendFile which uses the mime.lookup method from the mime module. |
@adamhalasz are the headers set after or before calling the download method?.. i ask because there are cases where custom |
@Nosthertus The content-type header is set in |
Thanks man! I really needed that. |
It will be great if you can provide a way to download file from a route to be something like that
The text was updated successfully, but these errors were encountered: