zoukankan      html  css  js  c++  java
  • js传真实地址 C:fakepath

    js给action传真是地址的时候,处于安全,传到action中 浏览器会改变路径变为C:fakepathftp.txt,但是原始路径却是

    C:Documents and SettingsAdministrator桌面ftp.txt

    下面就是获得原始路径的方法

    var url = getPath(document.getElementByIdx_x("url"))

    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;
     }
    }

  • 相关阅读:
    有点难度的二分
    请教神牛_字符串hash
    引水进城
    dp的斜率优化
    关于学习oi的一些事项
    永续债
    消费税
    增值税
    BSC交流
    钉钉吐槽功能点
  • 原文地址:https://www.cnblogs.com/zhujiabin/p/4971122.html
Copyright © 2011-2022 走看看