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