I want my servlet to receive files in some folder under the application directory tree. The server accepts files in multipart/form-data format. I've understood that @MultipartConfig
is the right attribute to mark the servlet code, to allow the server to create files. However, not every location is considered as safe, hence two questions:
- Which are the limitations, when specifying the locations for file-upload servlets
- Can the paths be relative to application path or they should be absolute?
- The files must be downloadable afterwards, so in general, which is a best place on the server to keep the files it (under the application tree, out of the tree, out of Tomcat tree etc?)
- Since annotation seems to be a very 'static' way to allow servlet download things, can the same be specified in web.xml, for example?
Thanks!