Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Upload File through Servlet problem  RSS feed

Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all. My co-worker is experiencing a strange problem. He is trying to do a
'simple' file upload through a servlet. The following code does the trick
using Internet Explorer both http and https but on Netscape it only works
through http. Using https on Netscape it always cuts off the last several
bytes of the file making it corrupt. Does anyone have any ideas? Code
snippet follows.
Thanks in advance.
StringBuffer sb = new StringBuffer();
ServletInputStream in = request.getInputStream();
int i =;
while (i != -1)
i =;

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!