I don't have session timeout problem and no error in the log itself.
Also memory space is enough to load 2.5 GB file.
I did put some log info inside form validation(), getter and setter
methods. After that i can see that validation(), getter and setter
method is called several times with null value on fields. Again this is
happening while uploading large file only.
So I was wondering if there is any issue of form initializing when the
request takes time? Does anybody have an idea?
Anjib
On 12/29/2010 1:56 PM, Aaron Brown wrote:
Have you investigated other issues outside the web application?
1) Does the server have enough room in the temp space where the file
is saved while it is being uploaded? Most web servers will store the
in-progress upload in a temporary default location, and will then copy
the file to the final destination when the upload is complete. You
must have enough room for the file in both places. If the server is
Linux/Unix, the temp area may be on a different hard drive volume with
less available space.
2) Does it take a lot longer to upload to the real server? You may be
having a timeout issue.
3) Do you have access to the server logs on the real server? You may
find an error listed there that might help. Remember to look in
general server logs, not just log files specific to your application,
since it might be a server error, not an application error.
On Wed, Dec 29, 2010 at 1:21 PM, Anjib Mulepati<anji...@hotmail.com> wrote:
Yes in this dummy program I can upload 1.5 GB file so 2MB may be the upper
limit.
Now in real app what can be the reason for getting text field value null
even I have enter something while uploading larger file. I can get the value
while working with smaller file.
Any idea?
Anjib
On 12/29/2010 11:55 AM, Paul Benedict wrote:
I believe uploading up to 2GB is supported by Struts 1. It relies on
Commons
FileUpload which has this limitation for older implementations.
On Wed, Dec 29, 2010 at 10:24 AM, Anjib
Mulepati<anji...@hotmail.com>wrote:
1. Find that we can change the max file upload size in struts-config file
http://struts.apache.org/1.x/userGuide/configuration.html
So set to 3GB.
<controller bufferSize="4194304"
processorClass="org.apache.struts.tiles.TilesRequestProcessor"
maxFileSize="3G"/>
2. Also in tomcat we can set maxPostSize
http://tomcat.apache.org/tomcat-6.0-doc/config/http.html
So set this to 3GB
But none of these help. :(
What can be other way?
Anjib
On 12/29/2010 10:03 AM, Dave Newton wrote:
The short answer is that you ignored everything I just said and didn't
look
at the Tomcat and/or commons docs I referred to, which is where I'd
start.
IIRC this is not configurable within Struts 1 itself, but I also haven't
used it for several years now.
Dave
On Dec 29, 2010 8:49 AM, "Anjib Mulepati"<anji...@hotmail.com> wrote:
I could not figure out where and what changes I have to make.
I try with simple app with following code:
1. JSP File
-------------
<html:form styleId="uploadForm" action="/upload"
focus="transactionName" method="post" enctype="multipart/form-data">
<div id="errorPlace" style="font-weight: bold; color: #b80000;"
aria-labelledby="errors" aria-live="assertive"><html:errors /></div>
<label for="transactionName" class="formLabel"><bean:message
key="transfer.name"/></label>
<html:text title="Transaction Name" styleId="transactionName"
property="trans_name" tabindex="1" size="35" />
<br />
<div id="fileSection" style="width: 345px">
<label for="upload_0" class="formLabel"><bean:message
key="transfer.upload"/></label>
<input title="File1" type="file" name="testFile[0]" id="upload_0"
tabindex="3" size="60" /><br />
</div>
<div id="blankLine"><br /></div>
<input title="Upload File" id="submit" type="submit" name="submit"
class="submitbutton" tabindex="8" value='<bean:message
key="button.send"
/>' /><br />
</html:form>
2. struts-config.xml
---------------------------
<action-mappings>
<action input="/welcomeStruts.jsp" name="UploadForm" path="/upload"
scope="request" type="com.anjib.actions.UploadAction"
validate="false"/>
</action-mappings>
3. UploadAction Class
------------------------------
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
return mapping.findForward(SUCCESS);
}
4. UploadForm Class
-----------------------------
public class UploadForm extends org.apache.struts.action.ActionForm {
private static Log log = LogFactory.getLog("UploadForm");
private String trans_name;
private List testFile;
public UploadForm() {
super();
testFile = new ArrayList();
}
public FormFile getTestFile(int i) {
System.out.println("FormFile is: " + testFile.get(i));
return (testFile.size()> i) ? (FormFile) testFile.get(i) : null;
}
public List getList() {
System.out.println("List of files: " + testFile.toString());
return testFile;
}
public void setTestFile(int i, FormFile f) {
if (f.getFileSize()<= 0) {
System.out.println("No file to add.");
f.destroy();
} else {
System.out.println("Adding new file.");
testFile.add(f);
}
}
public int getFileCount() {
System.out.println("Number of files: " + testFile.size());
return testFile.size();
}
public String getTrans_name() {
System.out.println("Transcation name is: " + trans_name);
return trans_name;
}
public void setTrans_name(String trans_name) {
this.trans_name = trans_name;
System.out.println("Set transaction name as " + this.trans_name);
}
/**
* This is the action called from the Struts framework.
* @param mapping The ActionMapping used to select this instance.
* @param request The HTTP Request we are processing.
* @return set of errors.
*/
@Override
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if (getTrans_name() == null || getTrans_name().length()< 1) {
errors.add("error", new
ActionMessage("error.transactionName"));
}
return errors;
}
}
Observation:
-----------------
1. I can get to blank page if try to load small file (tested up to
267MB
file)
2. No response for larger file(trrie with 2.85GB file)
What am I doing wrong?
Anjib
On 12/28/2010 3:32 PM, Dave Newton wrote:
Both commons-fileupload and Tomcat usually have a maximum file upload
size;
configure one or both.
Dave
On Dec 28, 2010 2:30 PM, "Anjib Mulepati"<anji...@hotmail.com>
wrote:
I am writing an app to upload file using Struts 1.3.8.
It works fine if I upload small file. But when I try to upload
lager(>200MB) file it doesn't response correctly.
For larger file my form validation get null for all field even I have
value in it.
This is happening to all browser IE,FF and chrome.
Anjib
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org