• Post Reply Bookmark Topic Watch Topic
  • New Topic

Upload files gives an OutOfMemoryError

 
Rudolf Castelino
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am writting a Java Client to upload a file to a Servlet.
I have used the URL class to do this, and i am using a Tomcat webserver.
I am able to upload files upto 35MB to the server, however, i am unable to upload file larger than this. I recieve an OutOfMemoryError if i try to upload file larger than this.
Can someone provide me with any help regarding this.

Regards
Rudolf
 
Rudolf Castelino
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have found the error.
When one opens a stream to a URL, and then tries to write to the ouputstream, the contents are written to the memory of the local machine.
In order to send the data to the URL, one has to request a response code from the URL
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!