upload binary file to redmine with node

别说谁变了你拦得住时间么 提交于 2019-12-06 11:39:40

Then uploading files using the Rest API, you have to send the raw file contents in the request body, typically with Content-Type: application/octet-stream. The uploaded file doesn't need any further encoding or wrapping, esp. not as multipart/form-data, JSON or XML.

The response of the POST request to /uploads.xml contains the token to attach the attachment to other objects in Redmine.

djcaesar9114

I faced the same issue and solved it this way:

  • Use "multer";
  • When you have an uploaded file, make a request using node "request" module, with req.file.buffer as body.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!