my dog learned polymorphism
The moose likes Servlets and the fly likes upload redirect to error page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "upload redirect to error page" Watch "upload redirect to error page" New topic

upload redirect to error page

grace chow

Joined: Oct 25, 2004
Posts: 13
I am using SmartUpload to upload file, the smartupload code are contained in uploadEngine.jsp . I am wondering if the unstable submit is due to ENCTYPE="multipart/form-data.. thanks your kind attention

function SaveForm() {


document.form2.mode.value = "save";
document.form2.action = "uploadEngine.jsp";

<form name="form2" method="post" action="" class="form" ENCTYPE="multipart/form-data">


<td class="Arial10" colspan="2">
<input type="file" name="upfile">

<td width="20%"> <input type="button" name="Save" value="Save" onKlick="SaveForm()">

<td width="80%">&nbsp;



I have use the Post form to upload something by JSP. However, the upload is sometimes done successfully, sometimes the upload is NOT successful and redirect to another error page. Is there anyone have experience of having this problem. It is difficult to solve problem sometimes ok and sometimes not ok!!

[ October 25, 2004: Message edited by: grace chow ]
[ October 25, 2004: Message edited by: grace chow ]
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

the multipart/form-data is required for file uploading.
You say sometimes it works, sometimes it doesn't. Are you using the O'Reilly upload code? Not sure if they updated it, but when I last used it, it had hardcoded file size and connection timeout limits. We had code that worked perfectly in the office and failed about 50% in production due to timeouts. I think it was a bit hard to chase due to poor exception reporting.

Hope this helps,
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
how abour jakarta commons project??
I agree. Here's the link:
subject: upload redirect to error page
It's not a secret anymore!