input type file lose efficacy

来源:互联网 发布:淘宝店铺会员怎么取消 编辑:程序博客网 时间:2024/06/14 10:51

when I use input type file to upload excel, the first time , it's okay. and then it lose efficacy.

because after I upload file , I also download it with error messages when it make mistake. earlier , I think it must be the problem of download, and so try to refresh the page, but after refresh the page use setTimeOut or close the page , it cause another problem, it may lead the download disappear.

at last , I found which I should only do is change the upload input after uploading excel

remove the original input, and then use js to make another one .like below:


$(cloestForm).submit();
    $(obj).remove();
    $(cloestForm).html('<a href="javascript:;" class="file">点击导入国内门店<input type="file" name="excelChina" onchange="fileType(this)"/></a>');
   

原创粉丝点击