How to get the full path to upload a file in jsp?

On my jsp page, use file upload and send the file for the line to the java page to copy to a specific folder. I want all the way to copy my file. but I only get the file name with the extension.

scan file: ABC.pdf

shows only: ABC.pdf

I want to show: c: /abc.pdf

+4
source share
3 answers

JSP - , HTML ( ), - . , . .

jsp :

<form action="UploadServlet" method="post"
                        enctype="multipart/form-data">
<input type="file" name="file" size="50" />
<br />
<input type="submit" value="Upload File" />
</form>

, .

JSP/Servlet?

+1

. . . . . , .

On the server side, you decide where to save the file. Obviously, you would not want the user to solve this. Allowing them to decide where to save the file on your server will enable them to overwrite system files.

0
source

Source: https://habr.com/ru/post/1534206/


All Articles