how to work with binary data inside a Rev cgi script ?
jbv
jbv.silences at club-internet.fr
Mon Apr 7 15:21:30 EDT 2008
Hi again,
For those interested (if any), I finally succeeded in merging pdf code
from a Rev cgi with binary pdf code from a php script...
Actually, I used a tradeoff : I modified the php code so that the binary
code doesn't need any further processing when imported inside the cgi script.
It works, which is the most important for me right now, although I'm still not
sure how to handle binary data inside a Rev cgi script...
Anyone with an elegant solution is welcomed.
Best,
JB
> 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
> >
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode
mailing list