Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Retrieving the image from Oracle database

1000034Mar 29 2013 — edited Apr 4 2013
I am facing a issue in retrieving the image from the Oracle database and display it in IE8.0.

Images are partially loaded in IE8.0 but it is displaying correctly in Firefox.
After further research, I realized that IE has some issues with base64_encode and it displays only 32KB.

This is the snippet of code which I am using to get the image from the data. The size of the Image stored in the database is 270KB.

$img = $row['DOCUMT']->load();$b64Src = "data:image/jpeg;base64,".base64_encode($img);echo '<div><img src="'.$b64Src.'" alt="image" width="700" height="300" /></div>'

one more thing I noticed is after retrieving the Image from the database, image_type_to_mime_type($img) is returning as application/octet-stream.

Is it anything to do with this? I tried, $b64Src = "data:application/octet-stream;base64,".base64_encode($img);

Nothing is working.
Please don’t ask me why you cannot store the images in the server instead of database. I was told to find a solution to this issue.
Is there any way this issue can be resolved? I badly need your help and suggestion.

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 2 2013
Added on Mar 29 2013
5 comments
6,213 views