how to work with binary data inside a Rev cgi script ?

jbv jbv.silences at club-internet.fr
Mon Apr 7 13:58:07 EDT 2008


Björnke,

The way I merge (or try to merge) the date from the cgi and the php
is pretty straightforward : I have a file that contains some pdf code
and a few keywords. Some keywords are replaced with pdf code
generated inside the cgi, and some other keywords are replaced by
code generated by the php. (a simple keyword can be replaced by
large portions of code).

The code from the php is simply called via the shell :
    get shell("/usr/bin/php4 myPHP.php ")
    replace myKeyword with it in myPDF

Finally the header is set in the Rev cgi. I'm certain that the header is
set correctly, because I tried to ouput the code from the php without
trying to merge it with something else, and it displays perfectly.

I also tried to use "binfile:" & thePath when reading my file at the beginning,
but no luck.
As for using put url ("binfile:" & thePath)", I'm not sure how it can fit into
my script...

JB


> A few things that can go wrong:
>
> How do you merge the data from the cgi, and the one from the php?
> Do you perchance use "put url ("file:" & thePath) instead of "put url
> ("binfile:" & thePath)"?
> Do you set the header in the cgi correctly, assuring the browser/pdf
> reader knows that you're sending binary, and not textual data?
> Are you sure all binary data uses the correct byte order?
> etc.
>
> You might be sure there is no problem, but that's no guarantee that it
> actually all works without error ;-)
>
> Have fun
> Björnke
>




More information about the use-livecode mailing list