Nodejs-express architecture to achieve file upload two big weapon:
1. Front-end asynchronous plug-in H5uploader
Https://github.com/expressjs/multer
2. Back-end processing Multer
Https://github.com/wewoor/h5uploader
The front and back end of the use of the two components in minutes to achieve file upload, powerful, code concise, the use of the method I will not say more, look at GitHub to know. Very simple.
But recently because multer updated version, use these two plug-ins will error, front-end plug-in H5uploader did not do processing. So I put out the solution.
The H5uploader framework is not available on the new version of Multer. A multipart:boundary not found error occurs. Workaround: Remove h5uploader.js 55th line of Xhr.setrequestheader ("Content-type", "Multipart/form-data");
If you specify content-type manually, the data behind the boundary= is lost. Because the new version Multer will force the checksum of the boundary= parameter, the above error will be reported without the parameter. Simply remove the content-type head to let the browser automatically add Content-type, such content-type is the complete
Nodejs Asynchronous upload Multer plug-in multipart:boundary not found error resolution method