Archived Forum Post

Index of archived forum posts

Question:

Best way to view hidden files via FTP?

Oct 31 '12 at 10:43

I'm wondering if there is a suggested way for bring back FTP files when calling NumFilesAndDirs. Previously I had been setting ListPattern = @"-a" but this is causing failures on certain servers and causes no files to be listed. I'm just wondering if there is a better suggestion?


Answer

The contents of the ListPattern property is passed to the "LIST" FTP command. What is possible/acceptable will depend on the server-side operating system as well as the FTP server implementation. It's safe to assume that all FTP servers and operating systems will support wildcarded filenames, where a "*" character indicates 0 or more of any characters.

However, things such as "-a" would only apply to Unix-based operating systems. Also, the concept of hidden files might also only apply on certain operating systems. There is no good solution other than to know the type of system on the server-side.