download files in loop
Posted: Wed 21 Sep 2016 14:32
Hi, I need to be able to download files with a given wildcard char in the name.
Is it possbile to loop over and download all files in a directory where the filename contains with eg "Jan"-
Case 4 files in dir;
budgetjanuary.txt
budgetapril.txt
turnoverjanuary.txt
turnoverapril.txt
i would like to automatically download 'budgetjanuary.txt' and 'turnoverjanuary.txt'
Not sure how to loop over the list of files on server directory
Is it possbile to loop over and download all files in a directory where the filename contains with eg "Jan"-
Case 4 files in dir;
budgetjanuary.txt
budgetapril.txt
turnoverjanuary.txt
turnoverapril.txt
i would like to automatically download 'budgetjanuary.txt' and 'turnoverjanuary.txt'
Code: Select all
handle := oSFTPClient.OpenDirectory(ExtractFilePath(ASettings.FileName));
oSFTPClient.ReadDirectory(handle);