Problem with displaying images from ORACLE database

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
novice4eva
Forum Contributor
Posts: 327
Joined: Thu Mar 29, 2007 3:48 am
Location: Nepal

Problem with displaying images from ORACLE database

Post by novice4eva »

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:

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();
?>
Would appreciate any suggestions...

Regards,
Deewen[/syntax]
Post Reply