Page 1 of 1

Retrieve image from database problem

Posted: Wed Mar 17, 2004 2:53 am
by THESiUS
I have a table and the field I am storing the image in is set to blob. Everytime I try to pull the image back out to view it, it only shows a portion of the image. It seems that if I upload a small enough image, it will show the whole thing though. Has anyone run into this problem?

Posted: Wed Mar 17, 2004 3:11 am
by seeker2921
I'm not sure but it soundes like timeout problem..

Posted: Wed Mar 17, 2004 4:19 am
by fastfingertips
I think that also depends on the image size :).
You must read the mysql about blob types as i remember you have other blob (bigger ones) that will help you to encode to whole image.

Also you may try to increase the server timeout period.

Image not retrieved!

Posted: Wed Mar 17, 2004 5:32 am
by shwathi
Hi,
Whatz the type of image file your working with? Is it svg?
Coz I've been facing with the same probs last month. And in my case I could retrieve images less than 8Kb of size and images with greater than that size failed to be retrieved. When I upgraded my browser, I found that everthing was fine working. So try upgrading ur browser no matter how latest ur version is. Make sure that ur cache is public in php configuration. If this still does work let me know the further details, I'll try suggeting u.

Bye, Good luck !
Shwathi 8)

Posted: Wed Mar 17, 2004 5:58 am
by freddy-a
Hi,

I'm trying to retrieve an image from a database but I can't get it to work :-(
Can anyone post some code to help me out?
I've tried a seperate file and various tips from other sites (hotscript.com and phpbuilder.com) but without succes...

I have a database in which I store the image (jpg). Now I want to show that image (along with some other information from the database) in an html page.

Please show some code, as things like:
To embed text and images within an html page, create the image program as a separate file and make sure that the image program returns image headers so that image.php will be viewed as an image by the browser.
Now just put your text in a separate file and at the place where you want the image to appear, embed it using
<img src="image.php?querystring">
where your querystring will pass the parameters required to create the image.
do not help me enough... (The idea behind it sounds cool, I've tried it. But I'm relative new to this subject and I couldn't get it to work with this little information...)


Thanx,

Freddy

Posted: Wed Mar 17, 2004 8:23 am
by THESiUS
The images I am storing in the database are jpg. I dont think its a timeout issue, because the images I am storing are like 60k.

Posted: Wed Mar 17, 2004 11:11 am
by freddy-a
Are you using blob for datatype? The max size for that is 65535 bytes.
Maybe you can try using mediumblob? The max size for a mediumblob is 1.6 Mb. It uses 1 byte more per record, so that propably won't cause any problems.

Greetz,
Freddy

Posted: Wed Mar 17, 2004 1:46 pm
by THESiUS
Well, mediumblob did the trick. I read somewhere that blob would work, but I guess not. Thanks a ton for your help!