How to download a file uniquely

0 votes
asked Jan 11, 2013 by Srinu (320 points)
edited Jan 15, 2013

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
answered Jan 11, 2013 by Lukas Matyska (43,890 points)
edited Jan 15, 2013

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);
commented Jan 15, 2013 by Srinu (320 points)
edited Jan 15, 2013

Thanks for your replay

...