Hello fellow developers!
Env: JBoss 7.1, JSF 2.0, Java 6, Richfaces 4.3.3
Problem: UploadedFile item is initialised, item.getName() returns name of uploaded file but item.getData() returns null.
I want to read uploaded file but I'm unable to get to the content.
In variables view of the debugger I can see item.uploadedResource.file = C:\appservers\jboss-as-7.1.1.Final\standalone\tmp\work\jboss.web\default-host\iCargo\richfaces_uploaded_file_8359107924056551868.tmp but there is no file at this location.
web.xml:
<context-param>
<param-name>createTempFiles</param-name>
<param-value>true</param-value>
</context-param>
Form:
<h:form enctype="multipart/form-data">
<rich:fileUpload id="upload" fileUploadListener="#{actionBean.uploadListener}"
acceptedTypes="xls,xlsx" immediateUpload="true" maxFilesQuantity="1">
</rich:fileUpload>
</h:form>
Bean:
private UploadedFile item;
public void uploadListener(FileUploadEvent event) throws Exception {
item = event.getUploadedFile();
}