cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: FTP get file in binary mode

From: Ashish Nigam <anigam_at_inmage.net>
Date: Tue, 21 Dec 2004 17:43:54 -0800

> Curl treats an empty first path element as an indication of a
root-relative
> path. i.e. Use ftp://<server_name>//absolute_path_to_file instead of
> ftp://<server_name>/path_to_file

Yup. This works great.

Thanks Dan.

----- Original Message -----
From: "Dan Fandrich" <dan_at_coneharvesters.com>
To: <curl-library_at_cool.haxx.se>
Sent: Monday, December 20, 2004 10:17 PM
Subject: Re: FTP get file in binary mode

> On Mon, Dec 20, 2004 at 09:02:35PM -0800, Ashish Nigam wrote:
> > Hi,
> > I have to download a file from FTP server machine in binary mode. Simple
isn't
> > it. But I am not able to figure out the right way till now.
> > As far as I know, there can be three options -
> >
> > 1) Set CURLOPT_URL to complete path of the file like
ftp://<server_name>/
> > path_to_file
> > The problem with this option is that it logs to home directory of
the user
> > rather than root or / .
> > And in this case, absolute path will fail because curl will try to
CWD
> > path_to_file which is true with respect to root rather than user home
> > directory.
>
> Curl treats an empty first path element as an indication of a
root-relative
> path. i.e. Use ftp://<server_name>//absolute_path_to_file instead of
> ftp://<server_name>/path_to_file
>
> >>> Dan
> --
> http://www.MoveAnnouncer.com The web change of address
service
> Let webmasters know that your web site has moved
Received on 2004-12-22