【问题标题】:Node js unsupported content-type application/octet-streamNode js 不支持的内容类型应用程序/八位字节流
【发布时间】:2014-10-08 22:58:52
【问题描述】:

我正在使用 koajs。我正在使用https://github.com/mscdex/busboy 来解析文件多部分。当我使用正常的多部分表单上传时,它工作得很好。但最近我正在尝试使用 ajax 上传器上传文件。每当我将文件放到输入框时,我都会得到

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)

我正在尝试使用 http://filedropjs.org/demo/ 上传

有什么解决办法吗?

谢谢, 尼克松

【问题讨论】:

    标签: ajax node.js file-upload jquery-file-upload koa


    【解决方案1】:

    找到了解决方案。它没有提交表单。 Busboy 只解析表单提交。我必须更改我的 ajax 上传器来解决这个问题

    【讨论】:

      猜你喜欢
      • 2015-08-11
      • 1970-01-01
      • 2012-02-03
      • 2023-02-02
      • 1970-01-01
      • 1970-01-01
      • 2021-12-08
      • 1970-01-01
      • 2011-04-30
      相关资源
      最近更新 更多