I have a requirement of uploading a large file over HTTP to a remote server. I am researching on how to send the data using multipart/form-data.
I have gone through How does HTTP file upload work? and understood how it separates the file data using boundaries.
I wanted to know whether all the file data is sent at one go or is streamed with several requests to the remote server.
Because if it is sent at one go, it is not possible to read the whole data at the remote server and write it to a file.
But if it streamed, how does the remote server parses the streamed data, write this streamed data to a file and redo the same thing till all the data is streamed.
Sorry if it a noob question, I am researching about it as well.
Maybe it is outside the scope of multipart/form-data and HTTP is itself taking care of.
Any help is appreciated.
I hope these help.
Express
for example), they process the incomming data (body) for you through core modules. Giving the feel that data comes as one go but actually they're not. (an example of such modules are multer
for file upload, express.json
for json payload in ExpressJS)form/multipart
for large file. As pointed out here, the file size limit is dependant on the server, so it's based your config.StreamAPI
and make your own custom stream (a cool concept is stream.pipe
).You might want to look at or this gist, or my blog. Good luck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With