Why Streaming?

The traditional API, which is described in the User
Guide, assumes, that file items must be stored somewhere, before
they are actually accessable by the user. This approach is convenient,
because it allows easy access to an items contents. On the other hand,
it is memory and time consuming.

The streaming API allows you to trade a little bit of convenience for
optimal performance and and a low memory profile. Additionally, the
API is more lightweight, thus easier to understand.

How it works

Again, the FileUpload class is used for accessing the
form fields and fields in the order, in which they have been sent
by the client. However, the FileItemFactory is completely
ignored.

Parsing the request

First of all, do not forget to ensure, that a request actually is a
a file upload request. This is typically done using the same static
method, which you already know from the traditional API.

// Check that we have a file upload request
boolean isMultipart = ServletFileUpload.isMultipartContent(request);

Now we are ready to parse the request into its constituent items. Here's
how we do it:

Apache Commons, Apache Commons FileUpload, Apache, the Apache feather logo, and the Apache Commons project logos are trademarks of The Apache Software Foundation.
All other marks mentioned may be trademarks or registered trademarks of their respective owners.