Aurelia js fie upload to server

ε祈祈猫儿з 提交于 2019-12-02 13:14:08

If it's a file and you are trying to upload a particular media type, the header 'Content-Type': 'application/x-www-form-urlencoded' does not seem right to me. Have a look at the appropriate media type here:

http://www.iana.org/assignments/media-types/media-types.xhtml

Also, you serialize data to JSON, if your data is binary you will need to change that to a byte array.

You might find some useful info here:

http://www.petermorlion.com/file-upload-with-aurelia/

Also you set a token both in your URL and your header, I'd recommend to set it in the header only.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!