I am working on file upload application.
<x:inputFileUpload id="myFileId" value="#{backing_CsvMain.uploadedFile}" size="50" required="true" storage="file"/>
<h:commandButton value="Submit" action="#{backing_CsvMain.Submit}"/>
My file is uploaded successfully.
<h:outputText value="#{backing_CsvMain.uploadedFile.name}"/>
After executing above line it will just print/return "Declaration.csv"
But I want full path " D:\Declaration.csv "
public class CsvMain {
UploadedFile uploadedFile;
public String Submit() throws Exception {
System.out.println("within submit");
try {
if (uploadedFile == null) {
System.out.println("License File is Null");
} else {
System.out.println("uploadedFile");
System.out.println("File type:" + uploadedFile.getContentType());
System.out.println("File name:" + uploadedFile.getName()); // it prints "Declaration.csv"
System.out.println("File size:" + uploadedFile.getSize() + "bytes");
}
} catch (Exception e) {
System.out.println(e);
return "false";
}
return null;
}
Please any body can tell how can we get full path.....................?