var obj=$("#xiaozhangPic")[0];
var filepath ="";
 if (window.navigator.userAgent.indexOf("MSIE") >= 1) {
    obj.select();
    filepath = document.selection.createRange().text;
} else if (window.navigator.userAgent.indexOf("Firefox") >= 1) {
    if (obj.files) {
        filepath =  obj.files.item(0).getAsDataURL();
    }
    else
    {
        filepath = obj.value;
    }
}       

   

注: 火狐的地址是火狐编码后的地址, 不是实际的文件地址, 不影响使用.

  ie下的是实际地址即使IE8也是获取实际地址的.

相关文章:

  • 2021-11-27
  • 2022-01-17
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2021-11-29
  • 2022-01-30
猜你喜欢
  • 2021-07-29
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
  • 2021-11-28
  • 2022-12-23
相关资源
相似解决方案