Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Component Overview

Wiki Markup\[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.unmigrated-wiki-markup

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!

...

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?BR

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!unmigrated-wiki-markup

*Q:* I'm using a [DiskFileItemFactory] from [FileUpload] 1.2.1. In the Resource Cleanup section of \[http://commons.apache.org/fileupload/using.html the User Guide\], the following code is shown:[BR] return new [DiskFileItemFactory](fileCleaningTracker,[BR] [DiskFileItemFactory]

return new DiskFileItemFactory(fileCleaningTracker,

DiskFileItemFactory.DEFAULT_SIZE_THRESHOLD,[BR]

repository);

[BR] This method doesn't actually exist (with the implied signature), so instead, I've done the following:[BR] [DiskFileItemFactory] factory = new [DiskFileItemFactory]();[BR]

DiskFileItemFactory factory = new DiskFileItemFactory();

factory.setFileCleaningTracker(fileCleaningTracker);[BR]

Is this how it should be done now?

...

A: The reason was Internet Explorer needs the following in Apache:unmigrated-wiki-markup

[SetEnvIf] User-Agent ".\*MSIE.\*" \ nokeepalive \
nokeepalive ssl-unclean-shutdown \[BR] \

downgrade-1.0 force-response-1.0

Zsolt

Wiki Markup
*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))

...