c# - Why doesn't FTPWebRequest, or WebRequest in general accept a /../ path? -


I am trying to automate some upload / download tasks from an FTP web server when I get to my directory If I connect to the server through the client or via Firefox, then I have to specify a path like this:

  ftp://ftpserver.com/ ./bd00000/incoming / Files>  

If I try to access it:

  ftp://ftpserver.com/AB00000/incoming/files  

the server is one Roots that the directory does not exist, therefore, the problem:

I am trying to create an FTPWebRequest with the first FTP address, but it always parses the "/../" portion and Then my server says that the path does not exist.

I have tried these:

  Uri target = new Uri ("ftp://ftpserver.com/../AB00000/incoming/files"); FtpWebRequest request = (FtpWebRequest) WebReqeuest.Create (target);  

and

  string target = "ftp://ftpserver.com/../AB00000/incoming/files"; FtpWebRequest request = (FtpWebRequest) WebRequest.Create (target);  

In the first bit, the path is already incorrect when the Uri object is installed, in the second bit, it is after the WebRequest.Create method. What is happening on any idea?

Edit:

Additionally, since I have posted it, I have tried to create a URI with a parse option. I have also tried to do something like this:

  string ftpserver = "ftp://ftpserver.com/../"; String path = "12345/01/01 / file.toupload"; Uri = new Uri (Fetserver, Path, Truth);  

and it always reads the original section ("/../").

Try to avoid something like this:

  Uri target = new Uri ("ftp://ftpserver.com/%2E%2E/AB00000/incoming / Files ");  

It works according to what I have found in it.


Comments