jsp - Tomcat: get file-path -
i have jsp-application on tomcat.
i have application upload files.
now want delete files. know relative url "aktionen/100" don´t know absolute path.
on localhost "c://daten/client/" example. want them dynamically because if host other path.
relying on relative paths bad idea beginning on. make upload folder externally configureable example vm argument or properties file setting. e.g. when start tomcat, add vm argument
-dupload.location=/path/to/uploads
then can follows:
file uploadfolder = new file(system.getproperty("upload.location")); file uploadedfile = new file(uploadfolder, "aktionen/100"); // ...
Comments
Post a Comment