> Take a look at the upload process in the Punk Image > Gallery sample app. It uses a modified version of > Jason Hunter's (O'Reilly ) multipart-mime handling > code.
Here is my version that Uses Jason Pell's library. Hunter's library has
that ugly licence.
Just extend PublicController, and override execute() method - everything
else is done for you (I use throwaway2 style controllers)!
If you want to access the uploaded files then just look at
multipartRequest field (or you can write public getter method if you
need that), eg.
MultipartContent multipartContent = null;
Iterator i = multipartRequest.iterator();
while (i.hasNext()) {
multipartContent = (MultipartContent) multipartRequest.next();
// Do something with uploaded file!
}
You can also modify the code if you for example like to store files in
disk, instead of memory (It might depend on how big files you are
transferring).
Regards
Aapo
PublicController.java
Description: Binary data
AbstractPreprocessingController.java
Description: Binary data
Controller.java
Description: Binary data
AbstractController.java
Description: Binary data
MultipartContent.java
Description: Binary data
