i need program that upload large binary files using FTP in Java

hi everyone,

i face problem while uploading a big binary files(say 50MB) using TCP/IP sockets in java which intenally uses the BufferStreamReader and bufferstream writer to read from local machine and write bytes on remote machine, it successfully upload files upto 20 MB but beyond that i get crashed.

Pls. assist how to get rid from this situation

Note:

i use thread which count upto 1000 times it read and write bytes in small chunks say byte of [4096] , when counter reaches 1000 it get some suspend state so that user checks how much data has been uploaded,

If someone needs more clarification on my problem feel free to reply on kulsingh@quark.com

Its very thory issue and i need to resolve it asap

[749 byte] By [singhGurpreeta] at [2007-11-27 11:04:49]
# 1

Reader and Writers with binary files?

sabre150a at 2007-7-29 13:04:27 > top of Java-index,Java Essentials,Java Programming...
# 2

Did you say that you are using 1000 threads to write?

jGardnera at 2007-7-29 13:04:27 > top of Java-index,Java Essentials,Java Programming...
# 3

> Did you say that you are using 1000 threads to write?

No, he didn't. He said he's using a thread that reports progress after every 1000 read/write ops.

thomas.behra at 2007-7-29 13:04:27 > top of Java-index,Java Essentials,Java Programming...
# 4

> which internally uses the BufferStreamReader and bufferstream writer

There is no such class, and you can't use Readers and Writers on binary data, as sabre150 said.

> it successfully upload files upto 20 MB but beyond that i get crashed.

You 'get crashed' how? This tells us nothing.

> Pls. assist how to get rid from this situation

What situation? You do realize that you haven't actually told us yet? Maybe the server you're uploading to has a 20MB upload limit.

> Note:

> i use thread which count upto 1000 times it read and write bytes in small

> chunks say byte of [4096],

Much too small. Make them at least 16k, preferably 64k.

> when counter reaches 1000 it get some

> suspend state so that user checks how much data has been uploaded,

Why? Why not just use a javax.swing.ProgressMonitor? Why aren't you using an FTP URL?

Make your life easier.

ejpa at 2007-7-29 13:04:27 > top of Java-index,Java Essentials,Java Programming...