cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: request a PDF file

From: Nayeem Syed <nayeem_at_flightline.co.uk>
Date: Wed, 23 Feb 2005 16:40:03 +0000

did you try sending the header 'Content-Type' in php before outputting it?

Freedom (FreedomMaster_at_GMX.net) wrote:
>
> Hi, I tried a curl request to get a pdf-document, but I got the content
> in my browser just as text instead of a PDF-format.
> I used the code below:
>
> $ch = curl_init();
> curl_setopt ($ch, CURLOPT_URL, "http://www.domain/wanted.pdf");
> curl_setopt ($ch, CURLOPT_HEADER, 0);
> curl_exec ($ch);
> curl_close ($ch);
>
> But it just seems to work on .html and .pdf files. Who can help me with
> a code that is working on .pdf ?
>
> Thank you for any helpful idea.
>
> Sincerely
>
> Fred
>
>
>
Received on 2005-02-23