Problem with displaying images from ORACLE database
Posted: Fri Jul 27, 2007 6:32 am
Dear all,
I am working on support for an old project that used LONG RAW to store the images, now they have changed the data type to BLOB in the database(Oracle). I have used the same piece of code that has worked perfectly well for BLOB types in other projects, but now the images won't load in my browser as it did, but if i change the header Content-Disposition to 'attachment' and give the extension of the file name to .jpg, the downloaded images does load.
Here is my code:
Would appreciate any suggestions...
Regards,
Deewen[/syntax]
I am working on support for an old project that used LONG RAW to store the images, now they have changed the data type to BLOB in the database(Oracle). I have used the same piece of code that has worked perfectly well for BLOB types in other projects, but now the images won't load in my browser as it did, but if i change the header Content-Disposition to 'attachment' and give the extension of the file name to .jpg, the downloaded images does load.
Here is my code:
Code: Select all
<?
require_once("../Init.php");
using("reports.Reports");//equivalent to include()
$objReport=new Reports();
$objReport->set($_GET['id'],'EMPLOYEE_CD');
$objReport->listWhoIsWhoImage();//The function which calls the SQL query
$row=$objReport->dbFetchArray(1);//Fetches the data
header('Content-type: image/jpeg');
header('Content-Disposition: inline; filename='.$_GET['id'].'.jpg');
echo $row['EMP_PICTURE']->load();
?>Regards,
Deewen[/syntax]