开发者

How to recover all the file path selected

开发者 https://www.devze.com 2023-01-20 22:31 出处:网络
I put a browser in my jsp page, and when I开发者_Go百科 select the file via the browser and I\'m doing a System.outn select the file path, I only have the name,

I put a browser in my jsp page, and when I开发者_Go百科 select the file via the browser and I'm doing a System.outn select the file path, I only have the name, and I need to recover all the file path selected

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


You cannot do this, for security reasons, file path from clients are not shown. But if really need to get the path, do not rely on the browser use applet.


The path would be useless for you, none the less. Moreover, as a privacy concern, its not really a good idea to know the path at client's machine.

0

精彩评论

暂无评论...
验证码 换一张
取 消