标签:for man file img proc name ssd post ons
html
<from method="POST" enctype="multipart/form-data" id="aaa" class="banneredit_from"> <p>文件:<input class="banneredit_input" type="file" name="file" id="bbb" /></p> <p><button value="上传" id="abc" >上传</button></p> </from>
jquery
$(‘#abc‘).on(‘click‘,function(){ var formData = new FormData($( "#aaa" )[0]); formData.append(‘file‘, $("#bbb")[0].files[0]); $.ajax({ url: "/appmanager/bannerController/bannerUploadImg", type: "POST", data: formData, contentType: false, processData: false, success: function(msg){ console.log(msg) } }); })
@
标签:for man file img proc name ssd post ons
原文地址:http://www.cnblogs.com/change-oneself/p/6349834.html