User (Old forums)MemberJune 17, 2013 at 10:21 amPost count: 23064
There are only two overloads for this method. My files that I’m trying to download are acting like they don’t exist, even though they do. It appears as though this method is case-sensitive, even though the documentation says that it’s not. I’m trying to download *.zip files (but they are actually *.ZIP). How do ignore case?
Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by ganders (had 1074 views)Diane [Xceed]ModeratorJune 17, 2013 at 11:57 amPost count: 1353
I gather the AbstractFile is an FTPFile object?
Case sensitivity depends on the actual target file system.
For DiskFile/DiskFolder, names are case insensitive because the Windows file system is case insensitive.
For FTPFile and FTPFolder, it is not as clear cut unfortunately. It depends of the FTP server you are connected to. Some FTP servers are case sensitive, others are not. The FTP specification does not enforce a specific rule. Based on this, it would appear that your server is case-sensitive.
Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Diane [Xceed] (had 181 views)User (Old forums)MemberJune 17, 2013 at 12:00 pmPost count: 23064
Is there a way to specify in my method call to ignore case? Or do I need to call the GetFiles method and send a name filter with a less than, like this: AbstractFolder.GetFiles(“<fiLEname.ziP”);
This is an FTPFolder…
Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by ganders (had 181 views)Diane [Xceed]ModeratorJune 17, 2013 at 4:50 pmPost count: 1353
By default, the NameFilter class is not case sensitive, but it can be forced to act as case sensitive by using “>”.
Using NameFilter normally makes it case insensitive. When GetFiles() is called, FtpFolder asks the server for all the files without using wildcards or masks. From the list that the server returns, the component then filters the results according to the Filter objects passed to GetFiles(), if any.
Based on this information, code like this:
AbstractFolder folder = new FtpFolder( ftp );
AbstractFile files = folder.GetFiles( false, “*.zip” );
should give you both “.zip” files and “.ZIP” files, and everything in between.
If you are not getting them, then maybe they aren’t part of the original file list. Are you sure you are listing the correct directory?
If you use the following code:
AbstractFile files = folder.GetFiles( false );
do you get all the files you would expect to be in that directory?
Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Diane [Xceed] (had 1252 views)
- You must be logged in to reply to this topic.