cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Using libcurl to return filename

From: <man_at_tfhs.net>
Date: Thu, 10 Aug 2006 16:08:12 -0000

On Thu, Aug 10, 2006, securehell_at_hushmail.com said:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi group,
>
> My appologies for cross-posting this to the curl-users group.
>
> I am using libcurl for a multithreaded app that downloads multiple
> urls. Some urls are exact files (e.g. www.myhost.com/file.txt)
> while others are just hosts (e.g. www.myhost.com), or
> subdirectories (e.g. www.myhost.com/directory) or even scripts
> (e.g. www.myhost.com/script.php?file).
>
> In all cases I want the filename of the actual file downloaded
> whether it is "index.html" or "setup.exe".
>
> Can libcurl return this information in a callback? I cannot seem to
> find it in any of the man pages or even the curl headers.

you cant find it, cause its not available. unless the server sends a
redirect back to you telling you that www.server.com is really
/index.html, you have no way of knowing what the filename was. In fact,
there may have been no file at all, think about mod_perl type websites...

allan

>
> Thanks,
>
> SH
> -----BEGIN PGP SIGNATURE-----
> Note: This signature can be verified at https://www.hushtools.com/verify
> Version: Hush 2.5
>
> wkYEARECAAYFAkTbUwkACgkQRBFe1uc9INoAIACfSV9BFtncZJji2HBwINCcuyspU7kA
> oLq1iKL/6mWWHTiij3RanL3EOT1o
> =T1w/
> -----END PGP SIGNATURE-----
>
>
>

-- 
m. allan noah
IT Director, TfHS.net
ph# (804) 355-5489
tf# (866) 724-9722
fx# (804) 355-0477
Received on 2006-08-10