<input type="file" name="excel"
style="position: absolute;width: 90px;
height: 40px;opacity: 0;
-ms-filter: 'alpha(opacity=0)';cursor:pointer;"
value="" onchange="fileupload()" multiple="multiple">
js 注意 : jquery-form.js layer插件 bootstrap的常用样式与jquery文件
function fileupload(){
$('#formlist').ajaxSubmit({
url:'/admin/commodity/import',
dataType:'json',
type:'post',
data:$('#formlist').serialize(),
success:function(res){
if (res.status == 0) {
layer.msg(res.msg);
} else {
layer.msg(res.msg, {icon: 1}, function () {
location.href = '';
});
}},
error:function(xhr, type){
layer.msg('');
} }); }