Parsing form-data multiparts

by Dejan Bosanac

If you ever needed to parse form-based multipart data, you are probably aware of the Jakarta Commons FileUpload library. But while this library is primarily intended to parse data directly from HttpRequest objects and thus handle uploading of files in your web application, it could be used to parse an arbitrary InputStream and extract multiparts from it too.

As you can probably guess, the part of the library that is related to handling file uploads is well documented, but for the low-level API you can only find the broken example in the JavaDocs. I know that this funcionality is rarely needed, but still it deserves a working example, so here it is.

1 Comments

Robert
2006-09-25 03:36:48
Hello,
I tryed to use this method but I could not find a working library. I've downloaded the latest nightly build from apache, but The MultipartStream class appears to be incomplete....any suggestions...10x