Hi,
I am using the following code to fetch a picture stored in database (blob type)
$sql = "SELECT PICTURE FROM NEW_PICT WHERE SR_NO = 1";
$stid = oci_parse($conn, $sql);
oci_execute($stid);
if(OCIFetch($stid)) //if file exists
{
$a=OCIResult($stid,"PICTURE");
}
file_put_contents('pics/test.jpg', $a->load());
The code works fine with no errors and it generate the picture "test.jpg". The image also opens in windows image viewer.
But when I try to open this image with Photoshop or any other image editing tool, the error occur "Invalid JPEG Marker" or "Invalid File Type"
Also the image dose not display in browser.
Please help.
Thanks