Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML


Java Tutorials



Struts Tutorials

Struts Resources

Visit Forum! Post Questions!
Jobs At RoseIndia.net!

How Can I Upload A File Bigger Than 2MB?, Struts Struts2 Struts 2 File Upload

User Comments
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl
  Blink   Furl   Simpy   Y! MyWeb 

Java Examples for Beginners
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

1 comments so far (post your own) View All Comments Latest 10 Comments:

I got an error with follow message.
Is there anybody knows how to solve this problem?
When i upload a file smaller than 2MB, it works so well-!!
Plea~~~~~se~~~~ help me.
I wanna destroy my laptop now...
org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (5096543) exceeds the configured maximum (2097152)

I attache pieces of my code.
## Struts.xml

<interceptor-stack name="authenticationStack">
<interceptor-ref name="fileUpload">
<param name="allowedTypes">
<param name="maximumSize">
<interceptor-ref name="basicStack"/>


<action name="RegisterUser" class="authentication.RegisterUser">
<interceptor-ref name="authenticationStack"></interceptor-ref>

## InputForm.jsp
<s:file name="photo" label="%{getText('user.photo')}" accept="image/*" />

## ActionClass.java
private File photo;// Client side file
private String photoContentType; // The content type of the file
private String photoFileName; // Server side file name

public File getPhoto() {
return photo;

public void setPhoto(File upload) {
this.photo = upload;

public String getPhotoContentType() {
return photoContentType;

public void setPhotoContentType(String uploadContentType) {
this.photoContentType = uploadContentType;

public String getPhotoFileName() {
return photoFileName;

public void setPhotoFileName(String uploadFileName) {
this.photoFileName = uploadFileName;



Posted by Kim on Tuesday, 08.14.07 @ 23:04pm | #23392

Ask programming questions?



Back to Tutorial
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification

Tell A Friend
Your Friend Name


Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright 2007. All rights reserved.