cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Getting filename from libcurl

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Thu, 10 Aug 2006 10:47:48 -0500

What you want is probably curl_easy_getinfo, and pass it the
CURLINFO_EFFECTIVE_URL option. It hands you back the effective url
after redirects have been followed, etc. It'll be a complete url, but
it's not too hard to hack off everything before the final /.

Ralph Mitchell

On 8/10/06, securehell_at_hushmail.com <securehell_at_hushmail.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi group,
>
> I want to obtain the actual download filename when I use libcurl.
> Some links may just be the host (e.g. www.myhost.com), others may
> be a subdirectory (www.myhost.com/directory), still others may be
> the output of a script (e.g. www.myhost.com/script.php?file).
>
> I want the actual filename that is downloaded whether it is
> "index.html" or "setup.exe" regardless of whether it is in the url
> or not.
>
> Can libcurl return the filename to me in cases like these?
>
> Thanks,
>
> SH
> -----BEGIN PGP SIGNATURE-----
> Note: This signature can be verified at https://www.hushtools.com/verify
> Version: Hush 2.5
>
> wkYEARECAAYFAkTbUccACgkQRBFe1uc9INpjrACgjYgujwNp5YyQN+JJpvoqVeEAuDgA
> n22Gzxu8TlfNmttD0HCCM2/k5/0L
> =jhi8
> -----END PGP SIGNATURE-----
>
>
>
Received on 2006-08-10