0
I have a Back-end
done in Java
where I get some files from the front and save them to a folder. This system ran on a server Windows
with Tomcat
but recently the same had to be migrated to Debian
.
In the past I set the path to save the files as follows:
D:\\Auditoria\\uploads\\
Currently the path in which I want to save these files is:
/opt/tomcat/modulos/auditoria/uploads
As I show in the following image
Can I pass this path to save my files? Or is there another way?
Currently I create my file this way:
private final String DIRETORIO_UPLOAD_ARQUIVO = "D:\\Desenvolvimento\\Angular\\Auditoria\\uploads\\anexos\\";
File arquivo= new File(DIRETORIO_UPLOAD_ARQUIVO, file.getFileName());
Since the user that Tomcat is attached to (user that starts the service) has write access, I see no problem!
– NilsonUehara
So at first glance just use the new URL.
– Jorge B.
You already tested that with the new URL?
– Jorge B.
@Jorgeb. I’m trying, it’s giving an Exception I’m trying to find the logs to analyze the errors
– DiegoAugusto
Must be somewhere in
/var/log
.– Jorge B.
As commented by Nilsonuehara may be a matter of writing permission.
– Fagner Fonseca
Go to the terminal and enter the command
#sudo chmod 777 /opt/tomcat/modulos/auditoria/uploads
this will release full recording permission, it is not a good practice to do this, but it is a solution.– joao paulo santos almeida