Good day!
My task is to upload files to the database and also save its path. I am already through with the Blob files but I have a problem with its filename. My boss wants me to get the complete path/location of the file that I am uploading. I mean, she wants to get where it is saved first before I upload it.
Ex.
C:/My Documents/User Files/WebApps/myWebApps/test.txt
currently I am using the following codes:
CODE 1:
File tempFileRef = new File(fi.getName());
System.out.println("Field = "+tempFileRef);
It only outputs:
Field = test.txt
which is not complete
CODE 2:
File tempFileRef = new File(fi.getName());
System.out.println("Field = "+tempFileRef.getAbsolutePath());
which also gives this wrong output:
Field = C:\Tomcat 5.5.23\bin\test.txt
Can someone please help me?
Thanks so much.
God bless.