Re: Download remote PDF using php code
Denis K <[email protected]> Thu, 3 Aug 2017 17:32:02 +0300
| Newsgroups | gmane.comp.web.curl.php |
|---|---|
| Message-ID | <CADs2cSScvbss5XmUUtnH_cCaLxptPvPO5PZeHtqRP-z1A6GT3w@mail.gmail.com> |
--===============1836799053== Content-Type: multipart/alternative; boundary="001a113f2a487cecff0555da3e89" --001a113f2a487cecff0555da3e89 Content-Type: text/plain; charset="UTF-8" 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 >> >> --001a113f2a487cecff0555da3e89 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto">Verify first off all what file hosts =C2=A0in the public = location=C2=A0</div><div class=3D"gmail_extra"><br><div class=3D"gmail_quot= e">On 3 Aug 2017 5:30 p.m., "Denis K" <<a href=3D"mailto:kuden= [email protected]">[email protected]</a>> wrote:<br type=3D"attribution"><block= quote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc= solid;padding-left:1ex"><div dir=3D"auto">Look for pure downloading you ju= st need denote to curl remote host and path to file and it could be perform= downloading. =C2=A0<div dir=3D"auto"><br></div></div><div class=3D"gmail_e= xtra"><br><div class=3D"gmail_quote">On 3 Aug 2017 4:23 p.m., "Stephen= Pynenburg" <<a href=3D"mailto:[email protected]" target=3D"_bla= nk">[email protected]</a>> wrote:<br type=3D"attribution"><blockquote= class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc soli= d;padding-left:1ex"><div dir=3D"ltr"><div><div><div><div>Hello Nour,<br></d= iv>Some basic steps to try for debugging:<br>- 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.<br></div>- what is the HTTP response cod= e? (use curl_getinfo()). Are you missing a redirect?<br></div>- does the se= rver require some cookies or other state to access the file?<br></div>- hav= e you looked in the response headers? Is content-length the same as expecte= d?<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, Au= g 3, 2017 at 7:59 AM, Nour Omar <span dir=3D"ltr"><<a href=3D"mailto:eng= [email protected]" target=3D"_blank">[email protected]</a>>= </span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .= 8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br> <br> I don't know, I'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> > On Aug 3, 2017, at 12:33 PM, Nima Sadjadi <<a href=3D"mailto:nsadja= [email protected]" target=3D"_blank">[email protected]</a>> wrote:<br> ><br> > Had you set the header() of your output page correctly?<br> ><br> ><br> </span>> ______________________________<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>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> --001a113f2a487cecff0555da3e89-- --===============1836799053== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KaHR0cHM6Ly9j b29sLmhheHguc2UvY2dpLWJpbi9tYWlsbWFuL2xpc3RpbmZvL2N1cmwtYW5kLXBocAo= --===============1836799053==--