Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes file upload functionality in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "file upload functionality in Java" Watch "file upload functionality in Java" New topic

file upload functionality in Java

PraveenKumar Kannankutty

Joined: Aug 02, 2005
Posts: 13

Iam using the following piece of code for implementing a file upload functionality. Iam able to upload an image of size 250Mb using the following code using fileInputStream and OutputStream.

byte[] buffer = new byte[8192];
while((bytesRead =,0,8192))!= -1)

But the same code doesnt holds good when I try to upload an image file o 500MB.

Can any suggests me a solution to fix this issue?

Thanks in Advance
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24183

"Doesn't holds good" in what way? What happens?

You've only shown us one end of the connection -- what's happening at the other end?

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: file upload functionality in Java
Similar Threads
Using Apache Commons Codec
send image in post method from J2ME to Servlet
Streaming out data using ServletOutputStream
Copy file from window machine to Linux machine using*
Download image from servlet