-
1. Re: UploadItem contentType via javax.activation
bek816 Jul 22, 2010 10:54 AM (in response to nimo22)I am having the same problem. I am not using temp files for the upload. The context type is always application/octet-stream. Is there a way to get RichFaces to correctly give me the right content type?
-
2. Re: UploadItem contentType via javax.activation
ilya_shaikovsky Jul 23, 2010 5:35 AM (in response to bek816)Guys, I just made simple check debugged livedemo sample. And see image/jpeg content type for file uploaded. Actually it's right result for the demo. Could you please provide more details(RF version? any other Filters installed?).
-
3. Re: UploadItem contentType via javax.activation
bek816 Jul 23, 2010 9:43 AM (in response to ilya_shaikovsky)Hi Ilya,
I have the following file upload component:
<rich:fileUpload fileUploadListener="#{backingBean.uploadFileListener}" immediate="true" immediateUpload="true" acceptedTypes="" allowFlash="true" ajaxSingle="true" autoclear="true">
....
</rich:fileUpload>
My RichFaces filter is:
<filter>
<filter-name>richfaces</filter-name>
<display-name>RichFaces Filter</display-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
<init-param>
<param-name>maxRequestSize</param-name>
<param-value>100000000</param-value>
</init-param>
<init-param>
<param-name>createTempFiles</param-name>
<param-value>false</param-value>
</init-param></filter>
In my backing bean, I have the following:
public void uploadFileListener(UploadEvent event) {
UploadItem uploadItem = event.getUploadItem();
...
}
uploadItem.getContentType() always return application/octet-stream. In my case, I was uploading Word docs, PDFs, and Windows Media files.
Thanks.
-
4. Re: UploadItem contentType via javax.activation
bek816 Jul 23, 2010 9:48 AM (in response to bek816)I should also add that I am using Tomcat 5.0.28 and RichFaces 3.3.2 SR1.
-
5. Re: UploadItem contentType via javax.activation
ilya_shaikovsky Jul 26, 2010 3:53 AM (in response to bek816)ah.. maybe using flash is the case.. I will check and update you.
-
6. Re: UploadItem contentType via javax.activation
ilya_shaikovsky Jul 26, 2010 4:24 AM (in response to ilya_shaikovsky)Thanks guys! https://jira.jboss.org/browse/RF-8977 created.