curl-library
Re: Curl issues with FTPing to / directory...
Date: Fri, 22 Aug 2003 13:25:33 +0200 (CEST)
On Thu, 21 Aug 2003, Philip Butler wrote:
> I have a libcurl app that needs to FTP into the '/' directory (on a Linux
> system). When I use a URL like:
>
> ftp://user:pass@ftp.domain.com/file.ext
>
> it actually FTP's into the user's directory instead of '/'.
Yes, this is what the RFCs define.
> The FTP user I have used is 'root', so it should be able to access / just
> fine (and yes, this is a test system behind a firewall, so please no
> comments about FTPing to root)
If the root's homedir is set to /, then it should login into that directory.
> When I use a URL like:
>
> ftp://user:pass@ftp.domain.com/path1/path2/file.ext
>
> it works fine.
That is not really true. This is also a URL that specifies a relative
directory from the directory you enter.
> Any clues as to why this is happening and how to get around it ??
The way to do it according to the RFC (which works with libcurl):
ftp://user:pass@ftp.domain.com/%2ffile.ext
but libcurl also supports a double-slash like in:
ftp://user:pass@ftp.domain.com//file.ext
-- Daniel Stenberg -- curl: been grokking URLs since 1998 ------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0Received on 2003-08-22