开发者

FtpWebRequest - How to compensate file upload when server defaults current directory to something other than / (root)?

When making FTP connections to some servers the server defaults the current directory to some directory other than the root.

For example:

/
  abc
    mno
      xyz

The server might default the connection to "/" root. Other servers might default to "/abc".

When uploading a file ftp://ftp.example.com/abc/mno/xyz/myfile.dat to the xyz directory, the FtpWebRequest returns a 550 when the current directory is something other than "/". i.e. FtpWebRequest is making the path /abc/abc/mno/xyz/filename.dat which isn't a valid path thus the 550.

Is there any special URI syntax that can compenstate for this so that the same URI works for both types of server default connect conditions?

OR is there some property of FtpWe开发者_运维问答bRequest that can be set to make it smarter?


This blog post seems to explain how to resolve the issue.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜