hi everyone. i've used the following way to store the uploaded files into D: drive of my windows machine from Tomcat server and it works pretty goood.
private final String directoryPath="D:\\uploadedFiles\\";
File f=new File("D:\\uploadedFiles\\"+fileName);
InputStream in=file.getInputStream();
OutputStream out=new FileOutputStream(directoryPath+fileName);
byte[] buff=new byte[4096];
int count=0;
while((count=in.read(buff))!=-1) {
out.write(buff, 0, count);
}
out.flush();
now, I want to store the same uploaded files in the linux machine which hosts the Tomcat server. Can i just change the directoryPath in order to store the files in that folder? E.g. /tmp/uploadedFiles ?? Please help me.
Thank you.