var fileObj = document.getElementById("file_excel").files[0]; // js 獲取文件對象
var formFile = new FormData();
formFile.append("action", "UploadVMKImagePath");
formFile.append("file", fileObj); //加入文件對象
var data = formFile;
$.ajax({
url: "/qhse_sxt/addFromExcel",
data: data,
type: "Post",
dataType: "json",
cache: false,//上傳文件無需緩存
processData: false,//用於對data參數進行序列化處理 這裏必須false
contentType: false, //必須
success: function (result) {
layer.msg('數據導入完成');
layer.close(index)
},
})ajax