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

curl-and-php

Re: Download remote PDF using php code

From: Stephen Pynenburg <spynenburg_at_gmail.com>
Date: Fri, 4 Aug 2017 09:17:45 -0400

Nour,
HTTP response code 0 means curl is not connecting to the server. I agree
with Atul - connect to the server using your web browser to ensure it is
actually online.
If your browser can connect but curl can't, call curl_error($curl) to
figure out what is going wrong.
Stephen

On Fri, Aug 4, 2017 at 7:22 AM, Atul Vaibhav <vaibhavatul47_at_gmail.com>
wrote:

> Are you able to download the file from any other agent eg. Chrome or
> Firefox using exact link ?
>
> Thanks,
> Atul Vaibhav
> Noida
>
> On Thu, Aug 3, 2017 at 8:02 PM, Denis K <kudenv_at_gmail.com> wrote:
>
>> Verify first off all what file hosts in the public location
>>
>> On 3 Aug 2017 5:30 p.m., "Denis K" <kudenv_at_gmail.com> wrote:
>>
>>> Look for pure downloading you just need denote to curl remote host and
>>> path to file and it could be perform downloading.
>>>
>>>
>>> On 3 Aug 2017 4:23 p.m., "Stephen Pynenburg" <spynenburg_at_gmail.com>
>>> wrote:
>>>
>>>> Hello Nour,
>>>> Some basic steps to try for debugging:
>>>> - is the PDF file on disk the same size as expected (i.e. how big is
>>>> the PDF)? If you are getting a much shorter response than expected, your
>>>> curl request is not receiving the PDF data and you need to find out why.
>>>> - what is the HTTP response code? (use curl_getinfo()). Are you missing
>>>> a redirect?
>>>> - does the server require some cookies or other state to access the
>>>> file?
>>>> - have you looked in the response headers? Is content-length the same
>>>> as expected?
>>>>
>>>> Stephen
>>>>
>>>> On Thu, Aug 3, 2017 at 7:59 AM, Nour Omar <eng.nour.omar87_at_gmail.com>
>>>> wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> I don't know, I'm not informed about it. I only used the code that i
>>>>> sent to you.
>>>>> Note: my pdf files contain designs (graphics).
>>>>> Can you please tell me what is missing that my code might work?
>>>>>
>>>>> Best regards
>>>>> Nour
>>>>>
>>>>> Sent from my iPhone
>>>>>
>>>>> > On Aug 3, 2017, at 12:33 PM, Nima Sadjadi <nsadjadi_at_gmail.com>
>>>>> wrote:
>>>>> >
>>>>> > Had you set the header() of your output page correctly?
>>>>> >
>>>>> >
>>>>> > _______________________________________________
>>>>> > https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>>>>>
>>>>> _______________________________________________
>>>>> https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>>>>
>>>>
>> _______________________________________________
>> https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>>
>>
>
> _______________________________________________
> https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
>

_______________________________________________
https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2017-08-04