亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - How to preview locally and determine the file size of locally uploaded pdf files (compatible with IE9 browser)
ringa_lee
ringa_lee 2017-07-05 10:40:29
0
1
1160

How to preview locally uploaded pdf files and determine the file size (compatible with ie9 browser)

ringa_lee
ringa_lee

ringa_lee

reply all(1)
黃舟
//文件大小可以根據(jù)此方法判斷,兼容ie8,ie9,ie9以上也支持 
function getFileSize(obj){ 
   try{
        var file = obj;
        file.select(); 
        file.blur(); 
        var path = document.selection.createRange().text; 
        var fso = new ActiveXObject("Scripting.FileSystemObject");
        fileSize = fso.GetFile(path).size; 
        alert(fileSize);//彈出文件大小
     }catch(e){ 
       alert(e+"\n"+"如果錯誤為:Error:Automation 服務(wù)器不能創(chuàng)建對象;"+"\n"+"請按以下方法配置瀏覽器:"+"\n"+"請打開【Internet選項(xiàng)-安全-Internet-自定義級別-ActiveX控件和插件-對未標(biāo)記為可安全執(zhí)行腳本的ActiveX控件初始化并執(zhí)行腳本(不安全)-點(diǎn)擊啟用-確定】");
        return window.location.reload(); 
   }}
  轉(zhuǎn)載鏈接:http://www.imooc.com/article/9593
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template