FTP.List with spaces inside the path

hennemarc

Member
Licensed User
Longtime User
:sign0085:Hi all,

I need to read on an FTP server the files and put them into a list. The command "FTP.List(serverpath)' works fine as long as there are no spaces inside that path.

--> /folder001/subfolder1/ works fine
--> /folder 001/subfolder 1/ does not work

Is there a trick or a work around to make that running?


Regards,

hennemarc
 

stevel05

Expert
Licensed User
Longtime User
I haven't tried it but normally url's that have spaces replace it with the escaped hex value. Try replacing the space with %20 and see if it works.

If not I'm sure someone that knows will be along to help out.
 
Upvote 0

hennemarc

Member
Licensed User
Longtime User
Thanks for your hint, but replacing the spaces with %20 does not work as well.

By the way, I discovered a strange situation. I can not read the files inside a folder which contains spaces in the folder name, but I can read out file names which contain spaces (as long as these files are located in folders without spaces).

The same behavior I have by listing directories. If I sent a FTP.List command to a directory which contains no spaces it lists all sub directories INCLUDING the folders which contain spaces.

Only the direct FTP.List command to the path which includes spaces does not work.


Regards,

hennemarc
 
Last edited:
Upvote 0

hennemarc

Member
Licensed User
Longtime User
Now I got it.

By using a "real" linux system and connecting with FTP to it I can list all files and directories with FTP.List, even if I do not put the escape sign in the path string. Just type FTP.List("/test 01/subfolder 001") works perfectly.

So the reason that it wasn't working is related to my other system, which is a NAS from my Fritz!Box.
 
Upvote 0

schampbakken

New Member
Licensed User
Longtime User
it wasn't working is related to my other system, which is a NAS from my Fritz!Box.

And did you have a solution for that?
I have the exact same problem with my Fritz!Box.
Is there something else needed for the folder name with a whitespace then "\ "?????
 
Upvote 0
Top