<form ID = " Form1 " Method = " POST " the enctype = " multipart / form-Data " > <the fieldset> <Legend> with Ajax submit Form form to the remote server of Api </ Legend> <div class = " form-Group " > <label class = " COL. 6-SM-Control-label " for = " ds_host " > select file </ label> <div class = " COL--SM. 4 "> <input type="file" name="file" id="inpFile" dirname="inpFile" /> </div> <div class="col-sm-2"> <input type="button" value="提交" id="inpUpload" /> </div> </div> </fieldset> <script src="/plugins/jquery-3.3.1.min.js"></script> <script src=" /Plugins/easyui/jquery.easyui.min.js " > </ Script> <Script> $ (Document) .ready (function () { $ ( " #inpUpload " ) .click (function () { var fileObj = $ ( " #inpFile " .) GET ( 0 ) .files [ 0 ]; IF (fileObj == null ) { Alert ( " Please select a file to upload " ); return false ; } $ ( "#form1").form("submit", { url: "http://localhost:19501/Files/ReceiveFileTest", onSubmit: function (params) { //提交前检查 return true; }, success: function (data) { console.log(data); var data = eval('(' + data + ')'); alert(JSON.stringify(data)); } }); }); }); </script> </form>