0 votes

I have a rather silly question. From our Server, which has a very good connection, will your component be able to handle a file of some 300GB in size? If there is a break, how is this handled?

I can use WinSCP need be, however, I thought I would give this a shot.

by

1 Answer

0 votes

There's nothing that should prevent this to work.

Internally download is done in 32 KB chunks, so no memory problems should occur.

Obviously don't use:

byte[] Ftp.Download(string remotePath) 

overload, as you'll be out of memory in no time.

Use:

void Ftp.Download(string remotePath, Stream destination) 

or

void Ftp.Download(string remotePath, string localPath).

When transfer is broken you can use

void Ftp.Download(string remotePath, long remoteStartPosition, Stream destination)

overload.

You should track download progress (Ftp.Progress event), so you know how much was already downloaded
and you can provide remoteStartPosition and seek to appropriate position in the destination stream.

You can also check size of file on disk on error and use that as a remoteStartPosition.

by (301k points)
...