https://stackoverflow.com/questions/43013858/ajax-post-a-file-from-a-form-with-axios

var formData = new FormData();

var imagefile = document.querySelector(\’#file\’);

formData.append(“stuff”, “some information”);

formData.append(“file”, imagefile.files[0]);

axios.post(\’upload_file\’, formData, {

headers: {

\’Content-Type\’: \’multipart/form-data\’

}

})

服务器端接收:https://stackoverflow.com/questions/10320232/how-to-accept-a-file-post 

https://docs.microsoft.com/en-us/aspnet/web-api/overview/advanced/sending-html-form-data-part-2

https://stackoverflow.com/questions/37414415/uploading-a-file-and-form-data-in-web-api-and-angularjs

版权声明:本文为teamleader原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/teamleader/p/7402546.html