cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: libcurl (perl) FTP download using wildcards

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 9 May 2003 09:27:57 +0200 (CEST)

On Thu, 8 May 2003, Miguel Laborde wrote:

> So what I've tried doing is to set the CURLOPT_URL just to the directory
> that the files will be located in and then using the CURLOPT_POSTQUOTE
> options I'm trying to get a diretory listing of the files in there, but
> this is failing.

If you specify a directory (ending with a slash) you'll get a directory
listing back automaticly. There's no need to POSTQUOTE for that.

Also, as Cris pointed out, the POSTQUOTE function doesn't understand and deal
with LIST (or any other file-transferring command) so thus it'll always fail
unconditionally when used there.

Other options you can play around with is FTPLISTONLY that changes the list
command to NLST, or you can set CUSTOMREQUEST to a string of your own choice
if you have any special list-command you want to use.

Just be aware that the file list you'll get is highly server-specific and
there's no standard saying how it should look. You need to make a very clever
parser to make it work on most servers...

I hope this helps. If not, ask again!

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com
Received on 2003-05-09