Pages

Saturday, July 9, 2011

How do I handle multipart form data? or How do I handle file uploads to my app?

Google App Engine for Java Questions - Google App Engine - Google Code
How do I handle multipart form data? or How do I handle file uploads to my app?

You can obtain the uploaded file data from a multipart form post using classes from the Apache Commons FileUpload package. Specifically you may want to use FileItemStream, FileItermIterator and ServletFileUpload as illustrated below.

If you see a java.lang.NoClassDefFoundError after starting your application, make sure that the Apache Commons FileUpload JAR file has been copied to your war/WEB-INF/lib directory and added to your build path.

import org.apache.commons.fileupload.FileItemStream;

No comments:

Post a Comment