IT改變世界 |
|
|||
看得見的未來 |
日歷
統計
導航常用鏈接留言簿隨筆分類隨筆檔案文章分類文章檔案搜索最新評論
閱讀排行榜評論排行榜 |
在IE8中上傳路徑變成了C:\fakepath\*,主要原因是因為微軟又體貼了用戶一把,如何解決呢?
1 工具 -> Internet選項 -> 安全 -> 自定義級別 -> 找到“其他”中的“將本地文件上載至服務器時包含本地目錄路徑”,選中“啟用”即可。
2
<script type="text/javascript">
function getPath(obj) {if (obj) { if (window.navigator.userAgent.indexOf("MSIE") >= 1) { obj.select(); return document.selection.createRange().text; } else if (window.navigator.userAgent.indexOf("Firefox") >= 1) { if (obj.files) { return obj.files.item(0).getAsDataURL(); } return obj.value; } return obj.value; } } //以下即為完整客戶端路徑 var filepath=getPath(document.getElementById("iptfileupload")); </script>
|
![]() |
|
Copyright © 愛品者 | Powered by: 博客園 模板提供:滬江博客 |