Branches Tags. Could not load branches. Could not load tags. Latest commit. Git stats commits. Failed to load latest commit information. May 22, Feb 18, Sep 7, Dec 17, May 10, Feb 21, Mar 25, Apr 2, The video format is MP4: app. Improve this question. I know absolutely nothing about nodejs well, a little, I guess , but shouldn't downloading a video file be just the same as downloading an image? Add a comment. Active Oldest Votes. Improve this answer. Muhammad Noman 1, 1 1 gold badge 15 15 silver badges 22 22 bronze badges.
Rama Rama 2 2 silver badges 4 4 bronze badges. Mihran Mihran 23 7 7 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Although it says downloading using wget , this example applies to downloading using curl with the -O option too. This method of downloading looks the most simple from coding point of view.
Why exec and not spawn? Because we just want wget to tell us if the work was done properly or not, we are not interested in buffers and streams. We are making wget do all the dirty work of making request, handling data, and saving the file for us. As you might have guessed, this method is the fastest among the three methods I described. So now the question is - which method is the best?
The answer - whatever suits your need. The wget method is probably the best is you want to save the files to the local disk, but certainly not if you want to send those files as a response to a current client request; for something like that you would need to use a stream. All the three methods have multiple options, you choice will ultimately depend on what your needs are. How to generate XML sitemap using Node.
If you are the technical kind, probably you want to us
0コメント