0 votes
by (350 points)
edited

I thought I had this figured out- this should be simple but I can't figure out what my problem is.

The following code is there to:

  1. Get a folder with files inside on the server then
  2. Put that folder with files in a specific folder on the users hard drive

{0} is the folder number based on the value in lblID.Text.

client.GetFiles(
    String.Format("/files/backuplogfiles/{0}", lblID.Text),
    (Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) & "\DailyLog\Files\*"),
    FtpBatchTransferOptions.Recursive,
    FtpActionOnExistingFiles.OverwriteDifferentSize)

I have similar code that allows the UPLOAD of folders and files and it works fine. I thought to download, it would be a simple reversal of my source and destination.

While my code doesn't error, it just doesn't do anything.

Am I missing something?

1 Answer

+1 vote
by (73.5k points)
edited
 
Best answer

It is suspicious the code doesn't fail, because your target path "xxx\*" is illegal. Please ensure you are not catching and silently ignoring an exception.

Please move the '*' wildcard to the source path instead:

client.GetFiles(
    String.Format("/files/backuplogfiles/{0}/*", lblID.Text),
    Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "DailyLog\Files"), 
    FtpBatchTransferOptions.Recursive, 
    FtpActionOnExistingFiles.OverwriteDifferentSize)
by (350 points)
edited

Perfect- thanks for your help!

...