Hello, I've found an example somewhere of an ftp client and re-used it myself. However, I found that it doesn't work all the time. I mean, if I redownload the same file over and over again and compare the actual bytes received there is a 50 % chance the file is correctly received, but also a 50 % chance that the file is incompletely downloaded. Could someone have a look at the example and tell me what I should add or what I'm doing wrong ? Thanks for your help, Dirk
You don't close the BufferedOutputStream, and Java isn't going to close it at shutdown: only the underlying file will be closed. Therefore, any data in the BufferedOutputStream's buffer may not actually ever be sent to the file. I suspect that if you explicitly close the BufferedOutputStream, the program will work fine.