This content has been marked as final.
Show 6 replies
-
1. Re: Restrict file upload size individually
pmuir Jun 27, 2007 7:04 AM (in response to codest)<s:fileUpload ... fileSize="#{foo.fixeSize}" />
Then check the fileSize in your action method. -
2. Re: Restrict file upload size individually
codest Jun 27, 2007 7:25 AM (in response to codest)Thank you very much, Pete.
Is this missing in the docs? I can't find it there (I'm using version 1.2.1.GA).
Regards,
Jörg -
3. Re: Restrict file upload size individually
pmuir Jun 27, 2007 8:14 AM (in response to codest)Yes it is, I'll update them :)
-
4. Re: Restrict file upload size individually
tazman Jun 27, 2007 8:22 AM (in response to codest)Is there a way to make s:fileUpload throw FileUploadException on a per case basis before reading the whole stream? I don't want uploading a file happens if I'll discard it anyway.
-
5. Re: Restrict file upload size individually
pmuir Jun 27, 2007 8:31 AM (in response to codest)Well http will post the file data to the server before invoking any JSF stuff - so its uploaded whatever. If you point data at a InputStream, then fileUpload doesn't read in the stream, you do in your backing bean.
-
6. Re: Restrict file upload size individually
tazman Jun 27, 2007 8:57 AM (in response to codest)If I have this in my components.xml
<component class="org.jboss.seam.web.MultipartFilter"> <property name="maxRequestSize">1000000</property> </component>
then the filter just checks the Content-Length of the HTTP request and throws the exception before reading the HTTP content if the length is bigger that the maxRequestSize. So the file is not really uploaded to the server and doesn't consume any memory resources.
Whereas, with<s:fileUpload ... fileSize="#{foo.fixedSize}" />
the filter reads the content and gives my backing bean the control to decide. I'd like to have the maxRequestSize behavior in this case as well. Is it doable? Is my understanding correct?
tazman