On a positive note - I'm really impressed with the elegance of the advanced fileUpload feature. I'm confident I'll get this resolved and excited about using it.
Eclipse Helios Java EE
Mac OS X 10.5.8
Java 6
JSF 2.1.7
PrimeFaces 3.2
Tomcat 7
Firefox 10.0
Using the fileUpload feature of PrimeFaces
<p:fileUpload id="imgUpl"
mode="advanced"
update="fileNameLabel"
fileUploadListener="#{imageBean.defaultUploadListener}"
allowTypes="/(\.|\/)(gif|jpe?g|png)$/"
sizeLimit="1000"
label="Select an Image File" />
I notice that including a sizeLimit causes an error message to appear.
In this case, attempting to select a file of actual size 532KB causes an error message that indicates that the file is 543KB. "Invalid file size" appears as a message in red in the file information label area. But the size limit is set for 1 MB so it isn't clear why the error message appears at all.
If I eliminate the sizeLimit attribute, I do not see any error messages and the upload is successful.
Any thoughts? Many thanks...
fileUpload - Error - Invalid file size
Thanks! That's exactly it. ( and if I had looked at the users guide more carefully I should have seen that )
Yes changing the sizeLimit value to 1000000 works.
Yes changing the sizeLimit value to 1000000 works.
Java 6 -- JSF Mojarra 2.2.1 -- PrimeFaces 4.0 -- Tomcat 7.0.34
Eclipse Juno Java EE -- Mac OS X 10.8.5 -- Safari 6.1.2 -- Chrome 35.0.1916
Eclipse Juno Java EE -- Mac OS X 10.8.5 -- Safari 6.1.2 -- Chrome 35.0.1916
- andyba
- Expert Member
- Posts: 2473
- Joined: 31 Mar 2011, 16:27
- Location: Steinfeld, near Bremen/Osnabrück, DE
- Contact:
If you are using a Windows client Explorer doesn't show you the exact file size either, you need to check the file Properties sheet to see the correct figure.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now
-
- Information
-
Who is online
Users browsing this forum: Google [Bot] and 39 guests