FTP Directory Name Problems (Spaces)

xsample

Registered
Apr 28, 2009
3
0
51
Hi there,

I have set up a universal FTP account and all works fine,
the problems start when I am signing up FTP accounts for certain directories on the server.

I have made an account that I want to start in directory:
/public_html/photos/Gallery One

There is a space in the address, that it does not seem to like.
It tries to start in (and it creates) directory without spaces, and gives cannot connect error. I have tried using the '%20' instead of spaces but its not happening.

The problem is that these directory names are pretty much set as they have a massive script behind them and changing them would be alot of work.

What can I type into CPanel to put the spaces in and be able to connect properly? There must be a (somewhat easy) sollution?

Any help would be great!

Thanks

XSaMPLE
 

Lyttek

Well-Known Member
Jan 2, 2004
775
5
168
As far as I know, you're a bit SOL :eek:

*nix system do not like spaces in paths or filenames; that's really a 'feature' of the Microsoft world.

My advice would be to work on the script... in the long run, having it correctly handle *nix path/file conventions will be a lot less hassle.
 

xsample

Registered
Apr 28, 2009
3
0
51
Thanks for the answer, even though it was really not the one I wanted.

The only problem is that the script (and the site) has been up and running for a while now with no problems, it is only now I am letting others upload photos to the site into directories that are already there, and full of photos. And the folder names are the page titles, and it also uses these folder names for other elements of the site.

Is there no work around? I mean can you create a redirect in ftp? or a virtual folder that I can use that can point to the directory with spaces?

I can point to the root of the galleries '/public_html/photos/' no problems, but didn't really want to give everyone access to all galleries.

Looks like ive hit a wall, I will try and work out a quick fix, but if anyone else can suggest anything that im missing, that would be a great help!

Thanks

XSaMPLE
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
As far as I know, you're a bit SOL :eek:

*nix system do not like spaces in paths or filenames; that's really a 'feature' of the Microsoft world.

My advice would be to work on the script... in the long run, having it correctly handle *nix path/file conventions will be a lot less hassle.
That is incorrect. Unix-like systems supported spaces in file names long before MS Windows. Applications must properly escape the spaces in order to access files and paths that contain spaces.

Browsers escape spaces with %20

Enclosing the full path in quotes, or preceding the space with a back slash often work for other applications, regardless of platform.

Quoted:
Code:
vim "/home/a user/ with spaces/in the_path_to/my document.txt"
[code]

Slashes:
[code]
vim /home/a\ user/\ with\ spaces/in\ the_path_to/my\ document.txt
@xsample: are you stating that you are unable to have new FTP accounts default home directory be set to a directory containing spaces in the directory name?
 

xsample

Registered
Apr 28, 2009
3
0
51
I have tried how you have suggested with the quotes and backslashes, but none seems to work. When the account has been created, it only shows the directory to the first space, and when I try to connect it gives an error.
As I said before, accounts with directories without spaces connect fine.

@xsample: are you stating that you are unable to have new FTP accounts default home directory be set to a directory containing spaces in the directory name?
Yes that is what I am trying to do. In CPanel under FTP Accounts, Add FTP account: Under directory, it does not let me enter a directory with spaces in the address.

Hope there is a solution.

Thanks

XSaMPLE
 

Lyttek

Well-Known Member
Jan 2, 2004
775
5
168
That is incorrect. Unix-like systems supported spaces in file names long before MS Windows. Applications must properly escape the spaces in order to access files and paths that contain spaces.
Ah, granted... what was I thinking? :eek:

I will say however that it's usually simpler to not use spaces, as you don't have to worry about escaping...