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"); // ... 

see also:


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -