I Use This!
Activity Not Available
Analyzed about 1 year ago. based on code collected about 1 year ago.

Project Summary

Spring MVC Multipart Upload support for GAEDownloads:gmultipart-0.1.jar - Works on Spring lib before 3.0 RC1. gmultipart-0.2.jar - Works on Spring lib 3.0 (from 3.0 RC1) gmultipart-0.2-java5.jar - Works on Spring lib 3.0 (from 3.0 RC1) compiled with java5 - thanks to pmatiello for the build file Overview:This implementation removes all the file handling related codes from the following files to make it work in Google App Engine.

org.springframework.web.multipart.commons CommonsFileUploadSupport.java --> GFileUploadSupport.java CommonsMultipartFile.java --> GMultipartFile.java CommonsMultipartResolver.java --> GMultipartResolver.java org.apache.commons.fileupload.disk DiskFileItemFactory.java --> GFileItemFactory.java DiskFileItem.java --> GFileItem.java org.apache.commons.io.output DeferredFileOutputStream.java --> GOutputStream.java Compile Time Dependencies (gmultipart-0.1.jar):commons-fileupload.jar commons-io.jar commons-logging.jar org.springframework.web-3.0.0.M4.jar / spring-webmvc.jar (2.5.6) org.springframework.core-3.0.0.M4.jar / spring-core.jar (2.5.6) Compile Time Dependencies (gmultipart-0.2.jar):commons-fileupload.jar commons-io.jar commons-logging.jar org.springframework.web-3.0.0.jar org.springframework.core-3.0.0.jar Demo:Edit your dispatcher-servlet.xml and add bean org.gmr.web.multipart.GMultipartResolver as shown below. Note: All the property settings that can be done in org.springframework.web.multipart.commons.CommonsMultipartResolver, can also be done in org.gmr.web.multipart.GMultipartResolver, except setting maxInMemorySize property. In this implementation, maxInMemorySize is defaults to maxUploadSize property value.

Lets consider this simple multipart html form.

Create a CommentForm.java to represent HTML form input fields 'comment', 'file1', 'file2', 'file3', 'file4', 'file5'. public class CommentForm {
private String comment;
private MultipartFile file1;
private MultipartFile file2;
private MultipartFile file3;
private MultipartFile file4;
private MultipartFile file5;

public String getComment() {
return comment;

public void setComment(String comment) {
this.comment = comment;

public void setFile1(MultipartFile file1) {
this.file1 = file1;

public void setFile2(MultipartFile file2) {
this.file2 = file2;

public void setFile3(MultipartFile file3) {
this.file3 = file3;

public void setFile4(MultipartFile file4) {
this.file4 = file4;

public void setFile5(MultipartFile file5) {
this.file5 = file5;

public MultipartFile[] getFiles() {
List files = new ArrayList();
if (file1 != null) {
if (file2 != null) {
if (file3 != null) {
if (file4 != null) {
if (file5 != null) {
return files.toArray(new MultipartFile[files.size()]);
}Create a CommentController.java to handle form post. @Controller
public class CommentController {
@RequestMapping(value = "/save", method = RequestMethod.POST)
public String addComment(CommentForm commentForm) throws IOException {

MultipartFile[] files = commentForm.getFiles();

for (int i = 0; i < files.length; i++) {
// Do stuffs!!!

return "redirect:/saved"; // redirect after processing!!!


appengine fileupload gae multipart spring upload

In a Nutshell, gmultipart...

This Project has No vulnerabilities Reported Against it

Did You Know...

  • ...
    Black Duck offers a free trial so you can discover if there are open source vulnerabilities in your code
  • ...
    by exploring contributors within projects, you can view details on every commit they have made to that project
  • ...
    65% of companies leverage OSS to speed application development in 2016
  • ...
    anyone with an Open Hub account can update a project's tags



30 Day Summary

Apr 9 2016 — May 9 2016

12 Month Summary

May 9 2015 — May 9 2016


Be the first to rate this project
Click to add your rating
Review this Project!