Hi
I'm trying to post a file to a
servlet.
Everything seems to be ok on application side, but the servlet doesn't work very well.
In the doPost method, I get the headers from the HttpServletRequest (filename, contentlength,...) and then get the inputStream. Headers contents are correct.
I try to write what comes from the inputStream (wrapped in a BufferedInputStream) to a FileOutputStream (wrapped in a BufferedOutputStream). When all is done, I would like to send a special status code (like 209) that means the file has been saved correctly and fully on the server. But the servlet seems to have problems. Since I get the inputStream, it often crash with an IOException "Unexpected command 31". (stack follows)
I don't understand why, I don't know what is wrong with my code. (see
http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=7&t=007313) Help me please. Thanks.