Hi Gurus,
I have a variable called $content which holds binary data(jpeg image). I want to display the jpeg in a web browser but I have to remove the first 5 bytes from the binary data before it will display properly. How would I remove the first 5 bytes on $content.
Thank you: Heres my code so far.
I have a variable called $content which holds binary data(jpeg image). I want to display the jpeg in a web browser but I have to remove the first 5 bytes from the binary data before it will display properly. How would I remove the first 5 bytes on $content.
Thank you: Heres my code so far.
Code:
<?
//$st = $_REQUEST['searchterm'];
//$ct = $_REQUEST['category'];
//open connection
$Connection = OCILogon("user", "pass", "db");
//create query
$Query = "SELECT * " .
"FROM BLD b, THN t WHERE b.BLDKEYI = 19 AND t.THNOBJKEYI = 19 " .
"AND rownum <=20";
$Statement = ociparse($Connection, $Query);
ociexecute($Statement);
while (OCIFetch($Statement))
{
//$type = OCIResult($Statement, "THNTYPS");
$content = OCIResult($Statement, "THNTHNB");
header("Content-type: image/jpeg");
//print($type);
$bcontent = chunk_split($content,5,);
echo $bcontent;
exit;
}
?>