Giter Site home page Giter Site logo

Handling spaces in directory name. about ftp HOT 18 CLOSED

arxone avatar arxone commented on August 30, 2024
Handling spaces in directory name.

from ftp.

Comments (18)

darrell-aevum avatar darrell-aevum commented on August 30, 2024 1

Yes Sir, sorry about that.

from ftp.

darrell-aevum avatar darrell-aevum commented on August 30, 2024

Also, FileZilla is the only server I've had this issue with. It works fine with other FTP Servers.

Thanks for the great library.

from ftp.

picrap avatar picrap commented on August 30, 2024

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?

from ftp.

darrell-aevum avatar darrell-aevum commented on August 30, 2024

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!

from ftp.

picrap avatar picrap commented on August 30, 2024

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.

from ftp.

darrell-aevum avatar darrell-aevum commented on August 30, 2024

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!

from ftp.

picrap avatar picrap commented on August 30, 2024

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.

from ftp.

darrell-aevum avatar darrell-aevum commented on August 30, 2024

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.

from ftp.

picrap avatar picrap commented on August 30, 2024

After testing, I can't make it work with spaces, with or without escaping them. Can you give me a sample?

from ftp.

darrell-aevum avatar darrell-aevum commented on August 30, 2024

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

from ftp.

picrap avatar picrap commented on August 30, 2024

I did exactly the same in a branch on the project; unfortunately, it still doesn't work for me 😢
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.

from ftp.

Darrio avatar Darrio commented on August 30, 2024

Same problem with spaces in names(

from ftp.

picrap avatar picrap commented on August 30, 2024

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).

from ftp.

picrap avatar picrap commented on August 30, 2024

Note to @Darrio : the spaces in name bug was introduced because of FileZilla... And it is fixed in 1.9.2

from ftp.

darrell-aevum avatar darrell-aevum commented on August 30, 2024

Thanks again picrap! I will give it a shot in the morning.

from ftp.

darrell-aevum avatar darrell-aevum commented on August 30, 2024

Pricrap,
On the WindowsFileZillaFtpPlatform, I still have to override the EscapePath method with

        public override string EscapePath(string path)
        {
            return EscapePath(path, "");
        }

from ftp.

darrell-aevum avatar darrell-aevum commented on August 30, 2024

Correction... The override is not necessary. I was having an issue connecting to the FTP Server in general.

from ftp.

picrap avatar picrap commented on August 30, 2024

So I guess this issue can stay closed? :)

from ftp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.