Downloading files from FTP

whizkid123

Freshman
Joined
Dec 11, 2002
Messages
33
Location
India
Hi all! Im downloading files from an FTP server. The problem is multiple downloads or a filename* download. I don't have the exact filename with me. The filename consists of an ID followed by date and time. I have the ID but the data and time can be random. How do I download a file without knowing the exact file name. The wildcard character * also does not work. Can
anybody please help! Thanks in advance!
 
I don't think there is anything in the FTP protocol specification for downloading files with only a partial name. Is there a reason you can't get a directory listing?
 
You can issue commands to FTP servers to get a file listing. Depending on the server (NT vs. Unix for example), you may get away with "dir" thought "lst" (I think) is the standard FTP command. I haven't tried this with .NET but I know "back in the day" what got returned was a big string showing the directory contents. You can then find the filenames and do your own string compare to get the real filename.

It's a start if nothing else works.

-Nerseus
 
Back
Top