Closed darrell-aevum closed 8 years ago
Also, FileZilla is the only server I've had this issue with. It works fine with other FTP Servers.
Thanks for the great library.
Hi Darell,
unfortunately, I couldn't find a way to handle special characters in FileZilla. This has always been a problem for me and I don't know how to solve it.
As far as I remember, I've tried both to escape names and not escaping them, but could succeed.
Have you tried the MlsdEntries
function instead of ListEntries
?
Thanks for the quick response.
I've tried the MlsdEntries, but got the same 550 error.
I will keep messing around with it and let you know if I find a solution.
Thanks again!
There is a class named FtpPlatform
(there are also two inherited classes named WindowsFtpPlatform
and UnixFtpPlatform
. You can inherit from one of them to implement your own escaping (by overriding the EscapePath()
method), so you can probably make some tests. However, as I already did some, I'm not optimistic.
The GetSystem(session) method on line 172 of FtpClient.cs returns "UNIX emulated by FileZilla".
If I override the UniexFtpPlatform EscapePath and remove the space from the escape characters, it works fine.
Is there a setting on the FileZilla server that I might be missing?
Thanks again!
I have a lot of problems with FileZilla and its specific behavior. However, since you found a way to circumvent the problem, I'll make a specific fix. Thanks for pointing this out, I'll let you know once an update is available.
I haven't tested any other special characters other than the space, but it seems that FileZilla, though emulating Unix, isn't escaping characters.
Again, I'm not sure if I am missing a setting in FileZilla or not.
Thanks for the quick action.
After testing, I can't make it work with spaces, with or without escaping them. Can you give me a sample?
Basically I added a UnixEmulatedFileZillaFtpPlatform.cs to the ArxOne.Ftp.Platform namespace with the following override:
public override string EscapePath(string path) { return EscapePath(path, ""); }
Next I added UnixEmulatedFileZilla to the FtpServerType enum, then I added an "IF" statement to the GetServerType method to account for FileZilla:
if (system.ToLower().Contains("filezilla")) _serverType = FtpServerType.UnixEmulatedFileZilla;
Finally I added a case to the GetFtpPlatform method in the FtpClient.cs file.
case FtpServerType.UnixEmulatedFileZilla: return new UnixEmulatedFileZillaFtpPlatform();
Basically I made it account for a Unix Emulated File Zilla server and remove any escaping. I haven't had any issues with it.
I'm sure the "IF" statement could be refined.
Also, I'm not sure how differently my FileZilla server is setup from the norm.
Thanks, Darrell
I did exactly the same in a branch on the project; unfortunately, it still doesn't work for me :cry: I'll check the code and release it as a blind fix (I'll let you know here when it's released), you'll tell me if it's OK.
Same problem with spaces in names(
Hi guys, this should be fixed in version 1.9.1. It was my mistake: FileZilla works fine without escaping but my test was failing because FileZilla does not support STAT commands (and both LIST and STAT were in the same test, which is a shame).
Note to @Darrio : the spaces in name bug was introduced because of FileZilla... And it is fixed in 1.9.2
Thanks again picrap! I will give it a shot in the morning.
Pricrap, On the WindowsFileZillaFtpPlatform, I still have to override the EscapePath method with
public override string EscapePath(string path)
{
return EscapePath(path, "");
}
Correction... The override is not necessary. I was having an issue connecting to the FTP Server in general.
So I guess this issue can stay closed? :)
Yes Sir, sorry about that.
I'm trying to open a path on a FileZilla server that has spaces in it, but keep getting 550 error. Example ftpClient.ListEntries("/Test Folder") will be handled as "/Test\ Folder" on the server.
Is ArxOne.FTP changing the space character to "\ " or is FileZilla server doing that?
Thanks.