<div class="row">
<div class="col-md-4 ">
<div class="form-group">
<label for="file" class="col-md-3 control-label">文件</label>
<div class="col-md-8" style="overflow: auto;table-layout:fixed">
<input id="file" type="file" data-show-preview="false"/>
</div>
</div>
</div>
</div>
//文件
$("#file").fileinput({
language: 'zh',
uploadUrl: "/AjaxHandler/Core/AjaxUploadHandler.ashx", // server upload action
uploadAsync: true,
//enctype: 'utf-8',
maxFileCount: 1,
showUpload: false,
layoutTemplates: {
// actionUpload: '',//去除上传预览缩略图中的上传图片;
},
dropZoneEnabled: false,//是否显示标题
allowedFileExtensions: ['XLS', 'XLSX']
}).on("filebatchselected", function (event, files) {
$(this).fileinput("upload");
});
//====上传完成事件====
$('#file').on('fileuploaded', function (event, data, previewId, index) {
$.ajax({
url: "/AjaxHandler/Biz/Plan/AjaxPlanHandler.ashx?mode=getfalluploadlist",
type: "POST",
data: { file_path:data.response.Message,id:id },
success: function (msg) {
debugger;
var obj = jQuery.parseJSON(msg);
$("#colcount").val(obj.total);
$("#tableshow").html(TableDetail(3, obj.total, obj.rows));
},
error: function (e) {
$.TipsWarning(e);
}
});
});