Upload files to Spring + Wicket


What are the steps required to include a Java web application (developed using Spring + Wicket) to accept uploading client files to a specific directory on the server.
While Google, to answer this question, I see suggestions that / WEB -INF / some-directory should be used as a download location?
What is the reason for this best practice?
Is this location writable via a web application?
What happens to this place when you deploy a new version of a web application? Can / use any other directory?
Thanks

+3
source share
1 answer

Two possible reasons for using the WEB-INF subdirectory:

  • it is not displayed via HTTP

  • your application usually has write access to it

I would prefer to use a custom external directory (for example, configured in the context parameter or in the application configuration file); thus, you have fine-grained control over directory permissions.

AFAIK, uploading a file to Wicket is provided by the FileUploadField component , which gives FileUpload , which you can write to a file on your server.

/ , . Tomcat maxPostSize (. HTTP)

+1

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


All Articles