上次excel
function uploadStartSecond(dataType) { var id = "ImportDataSecond"; var file_name = $("#" + id).val(); if (file_name != "" && file_name != undefined) { $.ajaxFileUpload({ url: "../../Ajax/Common/ImportData.ashx?type=ImportDataByExcel", type: 'post', data: { DataType: dataType }, secureuri: false, fileElementId: id, //file控件id dataType: "json", success: function (data, status) { alert(data.Msg); }, error: function (data) { } }); } else { alert("未找到文件!"); } }
1.js使用ajaxfileupload.js实现文件上传
2.将文件转为字节
3.将字节转为excel保存到服务器
4.根据路径读取excel文件并转为dataSet
5.将dataSet写入数据库