What is the syntax for spaces in FTP return path?

Posted on 2011-05-02
Last Modified: 2013-11-29
Hello Experts,
What syntax do I need for a path in FTP that contains spaces?
Thank you
Question by:davidam
    LVL 16

    Expert Comment

    The FTP standard is silent on the issue so different FTP servers use different path separator characters.  This can be annoying if you want to write a script that works on multiple servers.

    Author Comment

    For me it is a client issue since it is our server.   I cannot even make the vba editor accept most of the things that I attempt.  It rejects double quotes, puts in semicolons and does all sorts of strange things. I suppose also, that if I make something work on one client, it will not work on another.  It sounds to me like I need to be going in the direction of temp directories on client machines.
    LVL 16

    Accepted Solution

    I made a new directory named "sub folder" on my local FTP site and then tested it using my local FTP client.  It worked for me and the protocol trace log shows that the command sent from client to server contained no quotes or anything, just plain CWD sub folder  (CWD = change working directory)
    Tue May 03 11:49:55  => ->- CWD sub folder
    Tue May 03 11:49:55  => Status: Executing command on the server
    Tue May 03 11:49:55  => Status: Connected to server - idle
    Tue May 03 11:49:55  => -<- 250 CWD command successful
    Tue May 03 11:49:55  => RawSend returning 250
    Tue May 03 11:49:55  => ->- PWD
    Tue May 03 11:49:55  => Status: Executing command on the server
    Tue May 03 11:49:55  => Status: Connected to server - idle
    Tue May 03 11:49:55  => -<- 257 "/sub folder/" is current directory

    Open in new window


    Assisted Solution

    I have been running the FTP from a batch file.  This works fine as long as there are no spaces in either the send and get lines or in the file folder location...vba can have problems naming the batch file properly if there are spaces. So my solution is to create a temp folder on the C drive and copy a temporary file with the ftp instructions to this directory and then run the application from inside the temporary file/folder. Probllm solved if not very elegant.

    Author Closing Comment

    The truth about this issue is as AlexPace says...ftp is silent about it and you need to create your own solutions...mine has worked for me.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Understanding FTPS File transfer is a common requirement in most Enterprises. While there are numerous ways to get a file from Point A to Point B over a network, perhaps the most common method still in use is FTP – File Transfer Protocol. FTP is …
    Creating an OSPF network that automatically (dynamically) reroutes network traffic over other connections to prevent network downtime.
    Viewers will learn how to properly install and use Secure Shell (SSH) to work on projects or homework remotely. Download Secure Shell: Follow basic installation instructions: Open Secure Shell and use "Quick Connect" to enter credentials includi…
    After creating this article (, I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now