File uplaod using MultipartRequest class file.

Although file gets uploaded successfully, I get the following WARNING message in my log file when ran on NT/2000 which is okay.

The message says:

"One of the getParameter family of methods called after reading from the ServletInputStream, not merging post parameters".

But when I run the same code on UNIX it gives me an ERROR message. (message same as above). That crahes my JSP in the UNIX enviro. Any idea why does this happen? pl. let me know ASAP.

My production environment is UNIX based.

Here goes the code that I wrote.

<form name="myform" method="post" action="upload_file.jsp" enctype="multipart/form-data">

<table border="1" bordercolor="white" cellspacing="1" cellpadding="2" align="center" bgcolor="#c9dced">

<% for (int i=1; i<=5; i++) { %>

<tr>

<td>

<font face="Arial, Helvetica, sans-serif" size="1">Document</font>

<input type="file" name=<%="\"documentNameTF" + i + "\""%> maxlength="100" size="30">

</td>

</tr>

<% } // end for %>

<tr>

<td colspan="2" align="center">

<input type="button" name="saveBTN" value="Add Documents" onClick="document.myform.submit()">

</td>

</tr>

</table>

</form>

file2: upload_file.jsp

<%if (request.getContentType().startsWith("multipart/form-data",0)) {

com.oreilly.servlet.MultipartRequest multi = new com.oreilly.servlet.MultipartRequest(request, path ,MAX_FILE_SIZE);

/* Retrieve Parameters from multi */

for (int i=1; i<=5; i++) {

if (multi.getFilesystemName("documentNameTF" + i) != null) {

slDocUrl = multi.getFilesystemName("documentNameTF1");

} else {

slDocUrl = "";

}

} // end for 1-5

multi = null;

}

%>

Thanks,

Rakesh.

[1951 byte] By [rakeshahuja] at [2007-9-26 2:38:29]
# 1

> Although file gets uploaded successfully, I get the

> following WARNING message in my log file when ran on

> NT/2000 which is okay.

>

> The message says:

> "One of the getParameter family of methods called

> after reading from the ServletInputStream, not merging

> post parameters".

>

> But when I run the same code on UNIX it gives me an

> ERROR message. (message same as above). That crahes my

> JSP in the UNIX enviro. Any idea why does this happen?

> pl. let me know ASAP.

> My production environment is UNIX based.

>

> Here goes the code that I wrote.

>

> <form name="myform" method="post"

> action="upload_file.jsp"

> enctype="multipart/form-data">

> <table border="1" bordercolor="white" cellspacing="1"

> cellpadding="2" align="center" bgcolor="#c9dced">

> <% for (int i=1; i<=5; i++) { %>

> <tr>

> <td>

> <font face="Arial, Helvetica, sans-serif"

> size="1">Document</font>

> <input type="file" name=<%="\"documentNameTF" + i +

&gt; "\""%> maxlength="100" size="30">

> </td>

> </tr>

> <% } // end for %>

> <tr>

> <td colspan="2" align="center">

> <input type="button" name="saveBTN" value="Add

> Documents" onClick="document.myform.submit()">

> </td>

> </tr>

> </table>

> </form>

>

> file2: upload_file.jsp

> <%if

&gt; (request.getContentType().startsWith("multipart/form-da

&gt; a",0)) {

&gt; com.oreilly.servlet.MultipartRequest multi = new

&gt; com.oreilly.servlet.MultipartRequest(request, path

&gt; ,MAX_FILE_SIZE);

&gt; /* Retrieve Parameters from multi */

&gt; for (int i=1; i<=5; i++) {

&gt; if (multi.getFilesystemName("documentNameTF" + i) !=

&gt; null) {

&gt; slDocUrl =

&gt; multi.getFilesystemName("documentNameTF1");

&gt; } else {

&gt; slDocUrl = "";

&gt; }

&gt; } // end for 1-5

&gt; multi = null;

&gt; }

&gt; %>

>

> Thanks,

> Rakesh.

I have exactly the same problem using jspSmartUpload on Unix.

Did you receive any answer to your message or did you find any solution?

Thanks.

Marc

mhumbert at 2007-6-29 10:09:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
I am also getting the same error. Any update on this.Regards,-Jog
joginderk at 2007-6-29 10:09:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
i m able to upload the file in the oracle blob field but when i retrive the field which is in pdf file format, it does not display anything but the code works very fine for a image file (gif/jpg), can u help me out
Deepakar at 2007-6-29 10:09:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...