【问题标题】:How to recover all the file path selected如何恢复所有选择的文件路径
【发布时间】:2010-10-19 18:08:56
【问题描述】:

我在我的jsp页面中放了一个浏览器,当我通过浏览器选择文件时 我正在做一个 System.outn 选择文件路径,我只有名字, 我需要恢复所有选择的文件路径

<form:form onsubmit="document.getElementById('idButton').value='Traîtement en cours ...'" action="ajouter.html"
           method="POST">



                <input type="file" name="cible">

                <input type="submit" id="idButton" name="ajouter" value="Ajouter" tabindex="50"/>

</form:form>


(ActionForm)

 String leChemin = (String) request.getParameter("cible");
 System.out.println("leChemin = " + leChemin);

【问题讨论】:

标签: java html jsp struts


【解决方案1】:

您不能这样做,出于安全原因,来自客户端的文件路径未显示。 但是如果真的需要获取路径,不要依赖浏览器使用applet。

【讨论】:

    【解决方案2】:

    这条路对你来说毫无用处,尽管如此。此外,出于隐私考虑,知道客户端机器上的路径并不是一个好主意。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-23
      • 2010-12-24
      • 2013-07-08
      • 2011-07-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多