Share via


FtpWebRequest: Does the slash matter?

For those of you who are curious: there is indeed a difference when we use the following uris as parameters for our FtpWebRequest class:

ftp://server/ParentDirectory

ftp://server/ParentDirectory/ (Note the slash at the end)

 

Let’s say we want to create a new directory named “new” in "ParentDirectory". With the first uri (without the slash) we issue:

MKD ParentDirectory\new

 

And with the slash at the end we issue

CWD ParentDirectory

MKD new

 

The same model is applicable for all ftp commands that the FtpWebRequest class supports

Comments

  • Anonymous
    July 25, 2008
    This is a current compile of the team's existing blogs on FtpWebRequest. I am going to update it periodically

  • Anonymous
    August 17, 2011
    Please elaborate it more...I mean what is the difference in both commands?