简体   繁体   中英

Nodejs Express: Unrecognized content-type

I'm attempting to send a file from a phonegap application to a nodejs server and am having problems with the content-type of the request headers.

Error: unrecognized content-type: multipart/form-data;boundary express=++++++

The code is taken directly from the example at Phonegap. When the server receives the request, it throws the above error. Any idea what could be causing this behaviour?

It's because the multiparty library version you are using requires there to be a space in between the semicolon after form-data and boundary. Information on how to fix it is located at here . Either update to use that version or change the file manually yourself, nested in the node_modules folder in your app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM