You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Component Overview

[http://jakarta.apache.org/commons/fileupload 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 [http://jakarta.apache.org/commons/fileupload/ FileUpload website]. If you don't find the information you need you can always contact us using one of the [http://jakarta.apache.org/site/mail2.html#Commons mailing lists].

External Resources

If you have a good example, add it here!

FAQ

Add your questions/answers here.

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.*" \
nokeepalive ssl-unclean-shutdown [BR]
downgrade-1.0 force-response-1.0

Zsolt

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 例外: java.io.NotSerializableException: org.apache.commons.fileupload.DeferredFileOutputStream
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java(Compiled Code))
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java(Inlined Compiled Code))
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java(Compiled Code))
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java(Compiled Code))
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java(Compiled Code))
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java(Inlined Compiled Code))
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java(Compiled Code))
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java(Compiled Code))
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java(Compiled Code))
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java(Inlined Compiled Code))
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java(Compiled Code))
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java(Compiled Code))
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java(Compiled Code))
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java(Inlined Compiled Code))
at java.util.Hashtable.writeObject(Hashtable.java(Compiled Code))
at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java(Compiled Code))
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java(Compiled Code))
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java(Compiled Code))
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java(Compiled Code))
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java(Compiled Code))
at com.ibm.ws.webcontainer.httpsession.BackedHashtable.commonSetup(BackedHashtable.java(Compiled Code))
at com.ibm.ws.webcontainer.httpsession.BackedHashtable.persistSession(BackedHashtable.java(Compiled Code))
at com.ibm.ws.webcontainer.httpsession.BackedHashtable.ejbStore(BackedHashtable.java(Compiled Code))
at com.ibm.ws.webcontainer.httpsession.BackedHashtable.storeSession(BackedHashtable.java(Compiled Code))
at com.ibm.ws.webcontainer.httpsession.BackedHashtable.put(BackedHashtable.java(Compiled Code))
at com.ibm.ws.webcontainer.httpsession.DatabaseSessionContext.sync(DatabaseSessionContext.java(Compiled Code))
at com.ibm.ws.webcontainer.httpsession.SessionData.sync(SessionData.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.httpsession.DatabaseSessionData.sync(DatabaseSessionData.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.httpsession.DatabaseSessionContext.checkForSessionWrites(DatabaseSessionContext.java(Compiled Code))
at com.ibm.ws.webcontainer.httpsession.DatabaseSessionContext.asyncExternalWrite(DatabaseSessionContext.java(Compiled Code))
at com.ibm.ws.webcontainer.httpsession.SessionAlarmListener.alarm(SessionAlarmListener.java(Compiled Code))
at com.ibm.ejs.util.am._Alarm.run(_Alarm.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))

Can anyone give me some idea to solve this question?

  • No labels