about ftp url

Hello, I found the solution. The problem is the Current Working Directory of the ftp user. If you type a url like ftp://<server>/path/test.txt it is used as a relative path ro the working directory. For example CWD is /test then the used path is /test/path/test.txt. If you want to use an absolute path, you have to type the url like ftp://<server>//path/test.txt. Then the file is uploaded in the folder /path/test.txt, without exception.


The URI may be relative or absolute. If the URI is of the form "ftp://contoso.com/%2fpath" (%2f is an escaped '/'), then the URI is absolute, and the current directory is /path. If, however, the URI is of the form "ftp://contoso.com/path", first the .NET Framework logs into the FTP server (using the user name and password set by the Credentials property), then the current directory is set to <UserLoginDirectory>/path.


For example, the URL "ftp://myname@host.dom/%2Fetc/motd" is interpreted by FTP-ing to "host.dom", logging in as "myname" (prompting for a password if it is asked for), and then executing "CWD /etc" and then "RETR motd".

This has a different meaning from "ftp://myname@host.dom/etc/motd" which would "CWD etc" and then "RETR motd"; the initial "CWD" might be executed relative to the default directory for "myname".

On the other hand, "ftp://myname@host.dom//etc/m

http://www.cs.tut.fi/~jkorpela/ftpurl.html


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值