Another important thing to note here is that I have changed your code to use a readStream. This is a much better way to do things because using any method with 'Sync' in the name is frowned upon because node is meant to be asynchronous. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 10 years, 2 months ago.
Active 2 months ago. Viewed k times. I'm using the ExpressJS and I've been trying this: app. MOV', 'binary' ; res. Can anyone help me with that? Improve this question. A 13k 4 4 gold badges 90 90 silver badges bronze badges. Thiago Miranda de Oliveira Thiago Miranda de Oliveira 5, 5 5 gold badges 18 18 silver badges 24 24 bronze badges. Just FYI. For using in production, you are better off using node. Apparently, it is much better suited for handling that.
The up-votes prove that there is no such thing as a dumb question : — user Many other questions that get flagged and down-voted are proof of that. This question most certainly isn't one though. It matches the guidelines : — Assimilater. The question you point out is different, here OP want to return a file to a client while this other question is about how to download a file using your server Node as a client e.
At lesast that's what I understood. Add a comment. Active Oldest Votes. Update Express has a helper for this to make life easier. MOV' ; You may also want to send a mime-type such as this: res. Improve this answer. Andre Christoga Pramaditya 51 1 1 silver badge 9 9 bronze badges.
Is there a way to get this information from the fs. I'm using a static file in this example but I'll use this download api for any files, passing the name of it.
Setting output filename works with res. If you have a question, create a new one, don't leave a comment. Express 4. Save my name, email, and website in this browser for the next time I comment. Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website. Leave a Reply Cancel reply Your email address will not be published.
Kotlin Split String example. Follow us Facebook Youtube Github. Tools Json Formatter. We use cookies to improve your experience with the site. Close Privacy Overview This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website.
We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent.
0コメント