-
1. Re: How to get the path of the uploaded files richface
iabughosh Mar 29, 2011 7:52 AM (in response to jobmathew)Dear Job,
add fileUploadListener to your component, here is the ex :
<rich:fileUpload style="width:40%"
doneLabel="Done"
progressLabel="Uploading..."
autoclear="true"
uploadData="#{RichBacking.richBean.uploadFiles}"
fileUploadListener="#{RichBacking.fileUploadListener}"
maxFilesQuantity="4"
immediateUpload="false"
noDuplicate="true"
listHeight="50"/>
your listener :
public void fileUploadListener(UploadEvent ue) {
String filePath = ue.getUploadItem().getFileName();
}
-
2. Re: How to get the path of the uploaded files richface
jobmathew Mar 29, 2011 7:56 AM (in response to iabughosh)i have tried it
am getting only the file name not the path of the file.
-
3. Re: How to get the path of the uploaded files richface
iabughosh Mar 29, 2011 7:59 AM (in response to jobmathew)sorry job,
try this :
String filePath = ue.getUploadItem().getFile().getPath();
Regards
-
4. Re: How to get the path of the uploaded files richface
jobmathew Mar 29, 2011 8:04 AM (in response to iabughosh)am getting the below NP exception
29.03.2011 14:02:34 com.sun.faces.lifecycle.ApplyRequestValuesPhase execute
WARNUNG: /Resource/FileUpload.xhtml @11,98 fileUploadListener="#{fileUpload.listener}": java.lang.NullPointerException
javax.faces.el.EvaluationException: /Resource/FileUpload.xhtml @11,98 fileUploadListener="#{fileUpload.listener}": java.lang.NullPointerException
-
5. Re: How to get the path of the uploaded files richface
jobmathew Mar 29, 2011 8:13 AM (in response to jobmathew)IN debuging i saw that the file inside the upload event is "NULL"
-
6. Re: How to get the path of the uploaded files richface
iabughosh Mar 29, 2011 8:14 AM (in response to jobmathew)please post the full stacktrace.
-
7. Re: How to get the path of the uploaded files richface
jobmathew Mar 29, 2011 8:17 AM (in response to jobmathew)does it mean that my
createTempFile is set to false ??
-
8. Re: How to get the path of the uploaded files richface
iabughosh Mar 29, 2011 8:39 AM (in response to jobmathew)try adding this attribute
immediateUpload="true"
if this is not working please attach the full trace & your web.xml.
-
9. Re: How to get the path of the uploaded files richface
jobmathew Mar 29, 2011 8:50 AM (in response to iabughosh)I got fixed it.
The probem was like in web.xml the
createTempFile was set to false.