Component Overview

Commons-FileUpload makes it easy to add robust, high-performance, file upload capability to your servlets and web applications.

A lot of information is available on the FileUpload website. If you don't find the information you need you can always contact us using one of the mailing lists.

External Resources


Q: When parsing a multipart request that exceeds the maxSize or if a file exceeds the maxFileSize, is there any way to drop the file/files from the parsing process and still return the field items?
I though of putting the field items in the query string but haven't tested it. Even if it would work, it wouldn't be a handsome solution!

Q: I'm using a DiskFileItemFactory from FileUpload 1.2.1. In the Resource Cleanup section of the User Guide, the following code is shown:

This method doesn't actually exist (with the implied signature), so instead, I've done the following:

Is this how it should be done now?

Q: I'm using FileUpload 1.1.1,when I use ServletFileUpload.isMultipartContent(request).This is said "Use the method on ServletFileUpload instead".But I can't find "isMultipartContent" method in ServletFileUpload........

Q: How do you use FileUpload in a JSR168 JSF portlet ?

Q: Very often when we try to upload a file (several types such as jpeg, ppt etc.) we get an error message from Internet-Explorer "page cannot be displayed"

Not always but very often (absolutely not reliable). We don't see any error messages, neither in apache nor in tomcat (as if there had been no request at all).

Apache is configured to redirect all non-SSL request to SSL, but I think that shouldn't cause any problems because that happens only once (the user must first log-in, then go through several dialogs before he can upload, thus the redirection is done much earlier).

Except that, everything is very stable.

Any ideas?

A: The reason was Internet Explorer needs the following in Apache:

SetEnvIf User-Agent ".*MSIE.*" \


Q: I use commons.fileupload to upload a file in my application, but it throws an exception called "NotSerializableException", the server which the application run on is WAS5.1 and struts 1.2.4. Here is the output log: [06/05/15 19:15:36:873 JST] 78adaa3 SessionContex E 例外: org.apache.commons.fileupload.DeferredFileOutputStream

Can anyone give me some idea to solve this question?

FileUpload (last edited 2009-09-20 23:48:40 by localhost)