Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.9k views
in Java FTP by (120 points)
Im using last version of free edtFTPj FileTransferClient

During downloading big file suddenly appear network breaking and connection fails.

using command: ftp.downloadFile(config.getPresentationCatalog()+"/"+files[i].getName().substring(0,files[i].getName().length()-4), files[i].getName().substring(0,files[i].getName().length()-4), WriteMode.RESUME);

after timeout function downloadCompleted(String) from listener is executed and file is deleted.
Why this downloadCompleted is executed when a file is not completed ?

How to save part of downloaded file ? Is this behavior proper ?

Im trying to check connection with timer and after breaking (before timeout) execute ftp.cancelAllTransfers() command to FileTransferClient object from another thread, but this command works only if the connection with server is present, after breaking not working and timeout is executing and file disappear.
If I am wrong please correct me.

Best Regards

1 Answer

0 votes
by (162k points)
In the advanced settings, do

setDeleteOnFailure(false)

By default partially downloaded files are deleted on failure.

Categories

...