Search code examples
ajaxnode.jsfile-uploadjquery-file-uploadkoa

Node js unsupported content-type application/octet-stream


I'm using koajs. I'm using https://github.com/mscdex/busboy to parse the file multipart. It's working perfectly when i'm using normal multipart form upload. But recently I'm trying to upload file using ajax uploader. Whenever I drop my files to the inputbox i'm getting

Error: Unsupported content type: application/octet-stream
at Busboy.parseHeaders (/home/st-solutions/m3/node_modules/co-busboy/node_modules/busboy/lib/main.js:66:9)
at new Busboy (/home/st-solutions/m3/node_modules/co-busboy/node_modules/busboy/lib/main.js:21:10)
at module.exports (/home/st-solutions/m3/node_modules/co-busboy/index.js:17:16)
at Object.exports.imageSaveAction (/home/st-    solutions/m3/application/controllers/productController.js:830:17)
at GeneratorFunctionPrototype.next (native)
at next (/home/st-solutions/m3/node_modules/co/index.js:74:21)
at Object. (/home/st-solutions/m3/node_modules/co/index.js:45:5)
at next (/home/st-solutions/m3/node_modules/co/index.js:90:21) 
at Object. (/home/st-solutions/m3/node_modules/co/index.js:45:5)
at next (/home/st-solutions/m3/node_modules/co/index.js:90:21)

I'm trying to upload using http://filedropjs.org/demo/

Is there any solution for this?

Thanks, Nixon


Solution

  • Found the solution.It's not submitting a form. Busboy only parses form submissions. I have to change my ajax uploader to solve this issue