Demo of multipart form/file uploading with hapi.js
.
npm install
npm run setup
npm run server
Then ...
npm run test
... or try:
curl --form [email protected] \
--form firstName=Melvin \
--form lastName=Mooney \
http://localhost:8080/submit
Other multipart/form-data
demos:
Hi,
Thanks for the code. I have a question though.
Instead of using
data.file.on('end',...)
as the trigger to send response, wouldn't it be better to usefile.on('finish',...)
as the trigger? Would it ensure that the buffer stream has indeed been written into the file before a response is sent?Could you have time to discuss this?
Thanks