Re: Download remote PDF using php code
Denis K <[email protected]> Thu, 3 Aug 2017 17:30:26 +0300
| Newsgroups | gmane.comp.web.curl.php |
|---|---|
| Message-ID | <CADs2cSRFKnP6s9=i2kba96PX626W1jkDSSmBSm8t2bXncYf5MA@mail.gmail.com> |
--===============1212940726== Content-Type: multipart/alternative; boundary="001a11370768c371d60555da3877" --001a11370768c371d60555da3877 Content-Type: text/plain; charset="UTF-8" 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 > > --001a11370768c371d60555da3877 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto">Look for pure downloading you just need denote to curl re= mote host and path to file and it could be perform downloading. =C2=A0<div = dir=3D"auto"><br></div></div><div class=3D"gmail_extra"><br><div class=3D"g= mail_quote">On 3 Aug 2017 4:23 p.m., "Stephen Pynenburg" <<a h= ref=3D"mailto:[email protected]">[email protected]</a>> wrote:<br = type=3D"attribution"><blockquote class=3D"gmail_quote" 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:<b= r>- 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 r= equest 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 cookies or other state to= access the file?<br></div>- have you looked in the response headers? Is co= ntent-length the same as expected?<br><div><div><div><div><br></div><div>St= ephen<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"><<a href=3D"mailto:[email protected]" target=3D"_blank"= >[email protected]</a>></span> wrote:<br><blockquote class=3D"gm= ail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-le= ft: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/<wbr>mailman= /listinfo/curl-and-php</a><br> <br></blockquote></div></div> --001a11370768c371d60555da3877-- --===============1212940726== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KaHR0cHM6Ly9j b29sLmhheHguc2UvY2dpLWJpbi9tYWlsbWFuL2xpc3RpbmZvL2N1cmwtYW5kLXBocAo= --===============1212940726==--