0 votes
by (320 points)
edited

Hi,

i want to download a file uniquely means if i am downloadding same file(Same Name and Same Size) it should not be download by the Rebex DLL

What should i do?

Regards,

Srinu

Applies to: Rebex FTP/SSL

1 Answer

0 votes
by (72.7k points)
edited

I don't know how would you to use it, but there are two ways:

1) you want to download files separately (you know source and target paths):

string sourcePath = "/data/file.txt";
string targetPath = "c:/data/file.txt";

FileInfo localFile = new FileInfo(targetPath);

// download only if local not exist or local has different size than remote
if (!localFile.Exists || localFile.Length != client.GetFileLength(sourcePath))
    client.GetFile(sourcePath, targetPath);

2) you want to download multiple files in one call:

string sourcePath = "/data/*.txt";
string targetPath = "c:/data";

client.Download(sourcePath, targetPath, 0, 0, ActionOnExistingFiles.OverwriteDifferentSize);
by (320 points)
edited

Thanks for your replay

...