I am uploading a file, for which I want to provide a relative path, because the program should work in both linux and windows env.
This is what I am using to upload
realPath = getServletContext().getRealPath(/files);
destinationDir = new File(realPath);
if(!item.isFormField())
{
File file = new File(destinationDir,item.getName());
item.write(file);
}
Any other means to directly provide relative path here
File file = new File(destinationDir,item.getName());
destinationDir
with/files
and it should work? – Peritoneum