Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

File upload error - getInputStream()

843835Mar 19 2003 — edited Mar 20 2003

Hi all,

This problem is about uploading files.

First, here`s my simple form:


<form name="form" action="receive.jsp" method="post">
<input type="file" name="filename" value="">
<input type="hidden" name="upload" value="true"/>
<input type="submit" name="send"/>
</form>

When I try to catch the file on the receive.jsp page,

...
myBean.download( request );
...


public class downloadBean{
...

public void download(HttpServletRequest request) throws IOException {
ServletInputStream in = request.getInputStream();


byte[] line = new byte[128];
int i = in.readLine(line, 0, 128);
...


}

I`ll get the following error:



java.io.IOException: This input stream has been closed
at org.apache.catalina.connector.http.HttpRequestStream.read(HttpRequestStream.java:196)
at javax.servlet.ServletInputStream.readLine(ServletInputStream.java:138)
.
.
.
.

What does this mean?


Regards,

eki



Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 17 2003
Added on Mar 19 2003
3 comments
330 views