This content has been marked as final.
Show 8 replies
-
1. Re: Getting File size during s:fileUpload
v.lukoyanov Nov 3, 2009 4:02 PM (in response to pkatta)Add following tag to components.xml:
<web:multipart-request max-upload-size="5242880" create-temp-files="true"/>
--------------
My seam website -
2. Re: Getting File size during s:fileUpload
pkatta Nov 4, 2009 6:30 AM (in response to pkatta)Hi,
I am having multiple file upload.
This will apply for single filesize or for all the upload file sizes? -
3. Re: Getting File size during s:fileUpload
v.lukoyanov Nov 5, 2009 12:38 PM (in response to pkatta) -
4. Re: Getting File size during s:fileUpload
cash1981 Nov 5, 2009 12:53 PM (in response to pkatta)
Vasilii L. wrote on Nov 03, 2009 16:02:
Add following tag to components.xml:<web:multipart-request max-upload-size="5242880" create-temp-files="true"/>
--------------
My seam websiteDoes this mean that the file is not held in memory?
-
5. Re: Getting File size during s:fileUpload
cash1981 Nov 5, 2009 1:28 PM (in response to pkatta)
Vasilii L. wrote on Nov 03, 2009 16:02:
Add following tag to components.xml:<web:multipart-request max-upload-size="5242880" create-temp-files="true"/>
--------------
My seam websiteAlso adding this to components.xml got me this exception:
java.lang.RuntimeException: Could not create Component: org.jboss.seam.web.multipartRequest Caused by: java.lang.IllegalArgumentException: component class is an interface: org.jboss.seam.web.multipartRequest
Are you sure you didn't include some other code in components.xml?
-
6. Re: Getting File size during s:fileUpload
cash1981 Nov 5, 2009 2:00 PM (in response to pkatta)
Vasilii L. wrote on Nov 05, 2009 12:38:
That is maximum upload size for one single upload.
--------------
My seam websiteI don't think this is an
exact
science, because it will check the header Content-Length, and the content header length is not necessary the same as the filesize?As shown from a snippet of MultipartRequestImpl it checks the Content-Length
public MultipartRequestImpl(HttpServletRequest request, boolean createTempFiles, int maxRequestSize) { super(request); this.request = request; this.createTempFiles = createTempFiles; String contentLength = request.getHeader("Content-Length"); if (contentLength != null && maxRequestSize > 0 && Integer.parseInt(contentLength) > maxRequestSize) { throw new FileUploadException("Multipart request is larger than allowed size"); } }
-
7. Re: Getting File size during s:fileUpload
cash1981 Nov 5, 2009 2:38 PM (in response to pkatta)I had to inject the component directly with values from components.xml. The web filter didn't work for me:
<component class="org.jboss.seam.web.MultipartFilter"> <property name="createTempFiles">true</property> <property name="maxRequestSize">104857600</property> </component>
-
8. Re: Getting File size during s:fileUpload
pkatta Nov 6, 2009 7:32 AM (in response to pkatta)Hi,
for this error u havet to put enctype="multipart/form-data" for the 'Form' Tag.