The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FTP Directory Name Problems (Spaces)

Discussion in 'General Discussion' started by xsample, Apr 28, 2009.

  1. xsample

    xsample Registered

    Joined:
    Apr 28, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  2. Lyttek

    Lyttek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    770
    Likes Received:
    3
    Trophy Points:
    18
    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.
     
  3. xsample

    xsample Registered

    Joined:
    Apr 28, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  4. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    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?
     
  5. xsample

    xsample Registered

    Joined:
    Apr 28, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    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.

    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
     
  6. Lyttek

    Lyttek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    770
    Likes Received:
    3
    Trophy Points:
    18
    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...
     
Loading...

Share This Page