Hi folks,
I got a windows com executable which returns a jpg image in a BSTR.
Let's say, the var that holds the data is $imgData.
With perl, in a cgi script, I may simpy write:
8<--------8<--------8<--------8<--------8<--------
$| = 1;
print "Content-type: image/jpeg\n\n";
binmode(STDOUT) ;
print $imgData;
8<--------8<--------8<--------8<--------8<--------
and the Image is propperly printed to the Client-Browser.
Now I want to achieve the same with php, but I just can't find a way to
treat the data as binary instead of a formated string.
As far as I know, echo $imgData shouldn't expect a formated string, as print
does.
(I know, returning a Safearray from the com executable would be a better way
and probably I will also do it that way, but at the moment, I'm trying to
solve this problem.)
It'll make me very happy if someone could give me a hint...
Many thanks in advance,
yours Henri
I got a windows com executable which returns a jpg image in a BSTR.
Let's say, the var that holds the data is $imgData.
With perl, in a cgi script, I may simpy write:
8<--------8<--------8<--------8<--------8<--------
$| = 1;
print "Content-type: image/jpeg\n\n";
binmode(STDOUT) ;
print $imgData;
8<--------8<--------8<--------8<--------8<--------
and the Image is propperly printed to the Client-Browser.
Now I want to achieve the same with php, but I just can't find a way to
treat the data as binary instead of a formated string.
As far as I know, echo $imgData shouldn't expect a formated string, as print
does.
(I know, returning a Safearray from the com executable would be a better way
and probably I will also do it that way, but at the moment, I'm trying to
solve this problem.)
It'll make me very happy if someone could give me a hint...
Many thanks in advance,
yours Henri
Comment