Nodejs Asynchronous upload Multer plug-in multipart:boundary not found error resolution method

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.