首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

IE浏览器下传文件时本地路径变成”C:\fakepath\”的有关问题

2012-08-22 
IE浏览器上传文件时本地路径变成”C:\fakepath\”的问题//判断浏览器类型 2var isIE (document.all) ? tru

IE浏览器上传文件时本地路径变成”C:\fakepath\”的问题

//判断浏览器类型 2          var isIE = (document.all) ? true : false; 3         var isIE7 = isIE && (navigator.userAgent.indexOf('MSIE 7.0') != -1);          var isIE8 = isIE && (navigator.userAgent.indexOf('MSIE 8.0') != -1);         var isIE6 = isIE && (navigator.userAgent.indexOf('MSIE 6.0') != -1);         var file = document.getElementById("uploadFile");  var path = null;if (isIE7 || isIE8) { file.select();//获取欲上传的文件路径             path = document.selection.createRange().text;            document.selection.empty();} var filepath = document.getElementById("uploadFile").value;if (isIE6) {path = filepath; }alert("--------------------"+path);

?

热点排行