L
L
Loligan2016-05-10 06:23:35
Java
Loligan, 2016-05-10 06:23:35

Unable to upload files to webapp folder. How to fix?

I'm trying to upload a file to the webapp folder where everything is stored. But nothing comes out. I write the path like this:
String rootPath = "src//webapp//files";
But for some reason it doesn’t work out in the end. Throws anywhere but not in this folder. It helps only if I roughly write the path to tomcat:
//home//user//apache-tomcat-8.0.33//webapps//ROOT//images
But this is no good. How to solve the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Kosarev, 2016-05-10
@jaxtr

src - directory with source code, Tomcat does not know about it at all.
And what do you understand by "upload files"? If you mean uploading user files to the server, then the web application directory is not the best option, because. files will be deleted with each redeploy. It is better to store user files in a directory created specifically for this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question