Re: Download remote PDF using php code

Atul Vaibhav <[email protected]> Fri, 4 Aug 2017 16:52:36 +0530
Newsgroups gmane.comp.web.curl.php
Message-ID <CALw9H_T=BwRhE4OY-1XQNROD_LU28mGLTva07AMJXj7cbewXVQ@mail.gmail.com>
--===============1163420307==
Content-Type: multipart/alternative; boundary="94eb2c0c884adadf6e0555ebb654"

--94eb2c0c884adadf6e0555ebb654
Content-Type: text/plain; charset="UTF-8"

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 <[email protected]> wrote:

> Verify first off all what file hosts  in the public location
>
> On 3 Aug 2017 5:30 p.m., "Denis K" <[email protected]> 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" <[email protected]>
>> 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 <[email protected]>
>>> 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 <[email protected]> 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
>
>

--94eb2c0c884adadf6e0555ebb654
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Are you able to download the file from any other agent eg.=
 Chrome or Firefox using exact link ?</div><div class=3D"gmail_extra"><br c=
lear=3D"all"><div><div class=3D"gmail_signature" data-smartmail=3D"gmail_si=
gnature"><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"ltr"><div =
dir=3D"ltr"><div><font face=3D"times new roman, serif" size=3D"2">Thanks,</=
font></div><div><font face=3D"times new roman, serif" size=3D"2">Atul Vaibh=
av<br></font></div><div><font face=3D"times new roman, serif" size=3D"2">No=
ida</font></div></div></div></div></div></div></div></div></div>
<br><div class=3D"gmail_quote">On Thu, Aug 3, 2017 at 8:02 PM, Denis K <spa=
n dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">kud=
[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div =
dir=3D"auto">Verify first off all what file hosts =C2=A0in the public locat=
ion=C2=A0</div><div class=3D"HOEnZb"><div class=3D"h5"><div class=3D"gmail_=
extra"><br><div class=3D"gmail_quote">On 3 Aug 2017 5:30 p.m., &quot;Denis =
K&quot; &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">kudenv@gm=
ail.com</a>&gt; wrote:<br type=3D"attribution"><blockquote class=3D"gmail_q=
uote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1e=
x"><div dir=3D"auto">Look for pure downloading you just need denote to curl=
 remote host and path to file and it could be perform downloading. =C2=A0<d=
iv dir=3D"auto"><br></div></div><div class=3D"gmail_extra"><br><div class=
=3D"gmail_quote">On 3 Aug 2017 4:23 p.m., &quot;Stephen Pynenburg&quot; &lt=
;<a href=3D"mailto:[email protected]" target=3D"_blank">spynenburg@gmail=
.com</a>&gt; wrote:<br type=3D"attribution"><blockquote class=3D"gmail_quot=
e" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">=
<div dir=3D"ltr"><div><div><div><div>Hello Nour,<br></div>Some basic steps =
to try for debugging:<br>- is the PDF file on disk the same size as expecte=
d (i.e. how big is the PDF)? If you are getting a much shorter response tha=
n expected, your curl request is not receiving the PDF data and you need to=
 find out why.<br></div>- what is the HTTP response code? (use curl_getinfo=
()). Are you missing a redirect?<br></div>- does the server require some co=
okies or other state to access the file?<br></div>- have you looked in the =
response headers? Is content-length the same as expected?<br><div><div><div=
><div><br></div><div>Stephen<br></div></div></div></div></div><div class=3D=
"gmail_extra"><br><div class=3D"gmail_quote">On Thu, Aug 3, 2017 at 7:59 AM=
, Nour Omar <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]=
om" target=3D"_blank">[email protected]</a>&gt;</span> wrote:<br><b=
lockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px =
#ccc solid;padding-left:1ex">Hello,<br>
<br>
I don&#39;t know, I&#39;m not informed about it. I only used the code that =
i sent to you.<br>
Note: my pdf files contain designs (graphics).<br>
Can you please tell me what is missing that my code might work?<br>
<br>
Best regards<br>
Nour<br>
<br>
Sent from my iPhone<br>
<span><br>
&gt; On Aug 3, 2017, at 12:33 PM, Nima Sadjadi &lt;<a href=3D"mailto:nsadja=
[email protected]" target=3D"_blank">[email protected]</a>&gt; wrote:<br>
&gt;<br>
&gt; Had you set the header() of your output page correctly?<br>
&gt;<br>
&gt;<br>
</span>&gt; ______________________________<wbr>_________________<br>
&gt; <a href=3D"https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php"=
 rel=3D"noreferrer" target=3D"_blank">https://cool.haxx.se/cgi-bin/m<wbr>ai=
lman/listinfo/curl-and-php</a><br>
<br>
______________________________<wbr>_________________<br>
<a href=3D"https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php" rel=
=3D"noreferrer" target=3D"_blank">https://cool.haxx.se/cgi-bin/m<wbr>ailman=
/listinfo/curl-and-php</a><br>
</blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
<a href=3D"https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php" rel=
=3D"noreferrer" target=3D"_blank">https://cool.haxx.se/cgi-bin/m<wbr>ailman=
/listinfo/curl-and-php</a><br>
<br></blockquote></div></div>
</blockquote></div></div>
</div></div><br>______________________________<wbr>_________________<br>
<a href=3D"https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php" rel=
=3D"noreferrer" target=3D"_blank">https://cool.haxx.se/cgi-bin/<wbr>mailman=
/listinfo/curl-and-php</a><br>
<br></blockquote></div><br></div>

--94eb2c0c884adadf6e0555ebb654--

--===============1163420307==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KaHR0cHM6Ly9j
b29sLmhheHguc2UvY2dpLWJpbi9tYWlsbWFuL2xpc3RpbmZvL2N1cmwtYW5kLXBocAo=

--===============1163420307==--