cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: libcurl FTP - downloading a single file

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 25 Mar 2008 20:42:59 +0100 (CET)

On Tue, 25 Mar 2008, Alla Bogolubov wrote:

Please don't top-post!

> Is specifying the file name in the URL the only way?

Yes, the only sensible way at least.

> If, for example I want to emulate mget of number of files that meet certain
> wild card mask (say *.txt), should I call curl_easy_setopt(curl,CURLOPT_URL,
> REMOTE_URL) which includes file name for each file?

Yes, but you should only set one URL for each transfer since libcurl can only
do one file per transfer.

> I login to ftp server with my credentials. I want to download a file which
> is not located in my home directory tree. This is the sequence of commands
> in UNIX ftp client:

> How can I implement this sequence of ftp commands with libcurl?

You set CURLOPT_URL to something like:

         ftp://sambuild:password@geniosol9//tmp/filesize

and invoke curl_easy_perform(). (Replace "password" with your actual
password.)

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2008-03-25