利用FormData异步提交content-type为jpg,等流方面信息 –2016.04.20
平常在提交一个包含上传文件流信息都是使用form表单提交,最近在业务上需要异步提交图片,以前都是用一些js上传组键,这次没有用组键,最后找到了用FormData对像来提交信息。FormData的本质是将提交的东西伪装成了form表单,但是,是异步的
<div><input type="file" id="file_attachment" name="file"/></div>
$("#file_attachment").change(function(){
var filedata = new FormData();
var file = $("#file_attachment")[0].files[0];
var nodeId = $("#node_page_nodeId_hidden").val();
var ipa = {
"categoryId":"SRVAPPR-00000009","productId":"","productName":"111111","engTuCode":"20160414103329737130","engTrCode":"2016041910454650560","engExecutorUc":"20160419104546663838","durationDay":"1","baseProduct":null};
var ur