I want to invoke a script on a remote server purpose is to generate a
pdf file and send it to the browser. I wish to capture the pdf in the
background and squirrel it away (since the remote site gives you no
direct option to do that.)
I searched the mailing list--surely someone else has wanted to do this!
One similar question was brushed off by suggesting that the reader read
the docs and examples and use the dead simple one. Another individual
asked a similar question and was advised to "set the options" and do it.
I have read all of the examples and I have read http://us2.php.net/curl
It lists a s**tload of options but it doesn't tell you what they do or
give examples. There are a bunch of functions that aren't documented.
I just wanted you to know that *I have done my homework.* I RTFM and
the FM is just a skoshe sketchy. Also I am using PHP 4.
This is my best guess so far.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_BINARYTRANSFER, TRUE); //just guessing
$fh = fopen("/home/www/mysite/demo/tests/testcurl.pdf",'w');
If you call the remote URL directly it sends you a PDF.
When I had the HEADER option set it wrote the header to testcurl.pdf
If not it wrote a blank line.
I want the actual PDF file to go to testcurl.pdf. How can I reference
it! People wouldn't keep asking this question if it was so obvious how
to do it!! Please tell me how to fix this script. I have been blind
guessing for the pass half hour. It would probably make a nice edition
to your examples too.
Received on 2006-08-21