This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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: 24187

"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