whizkid123 Posted January 2, 2003 Posted January 2, 2003 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! Quote
*Gurus* divil Posted January 2, 2003 *Gurus* Posted January 2, 2003 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? Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
*Experts* Nerseus Posted January 2, 2003 *Experts* Posted January 2, 2003 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 Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.