File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

upload redirect to error page

grace chow
Greenhorn

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() {

if(validate())
{

document.form2.mode.value = "save";
document.form2.action = "uploadEngine.jsp";
document.form2.submit();
}
}

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

<table>


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


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

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

</td>
</tr>



</table>
</form>



Dear,
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
Rancher

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,
Dave
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
how abour jakarta commons project??
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: upload redirect to error page