Home: Perl Programming Help: Intermediate:
storing a picture file in a BLOB



$0.05$
Novice

Mar 27, 2002, 3:00 PM


Views: 7946
storing a picture file in a BLOB

in mysql, is it possible to store an image file (*.jpg, *.gif) into a BLOB?

and if so, how??


$0.05$
Novice

Mar 28, 2002, 5:33 AM


Views: 7940
Re: [$0.05$] storing a picture file in a BLOB

well, is there any way to store an image file in a mysql database?


Paul
Enthusiast

Mar 28, 2002, 9:20 AM


Views: 7938
Re: [$0.05$] storing a picture file in a BLOB

Patience is a virtue :)

Yep it can be done but why would you want to?

VBulletin does it I think. Seems a bit of a waste of time.


Jasmine
Administrator

Mar 28, 2002, 10:48 AM


Views: 7933
Re: [$0.05$] storing a picture file in a BLOB

And a quick search at [url=http://google.com]Google turned up this tutorial with examples: [url=http://www.james.rcpt.to/programs/mysql/]http://www.james.rcpt.to/programs/mysql/


Jasmine
Administrator

Mar 28, 2002, 10:50 AM


Views: 7931
Re: [RedRum] storing a picture file in a BLOB

[ RedRum ] - there are certain instances where storing images in a db is useful. For example, storing images in the db would permit a logged in user access only to the files they have permission to access.

Surely someone will say that htaccess will work fine, but let's say that you have a variety of user levels, and each level has a access to increasingly more images or higher quality images. Would you create a subdirectory for each group of images and make the users get that dumb browser popup window for each subdirectory? Or would you copy all images from a lesser level to the higher level? Smile

I don't know how vBulletin uses their stored images, if only certain groups or levels of user can view images, then it makes sense. If they're just storing their global icons or images that anyone can see, well, I agree that it doesn't seem overly useful Smile


(This post was edited by Jasmine on Mar 28, 2002, 10:55 AM)


Paul
Enthusiast

Mar 28, 2002, 11:01 AM


Views: 7927
Re: [Jasmine] storing a picture file in a BLOB

Just beware that tables have a 2GB limit


PerlKid
stranger

Mar 28, 2002, 11:09 AM


Views: 7925
Re: [RedRum] storing a picture file in a BLOB

that all depends on your operating system... http://www.mysql.com/doc/T/a/Table_size.html
--Philip
FuzzyLogic at PerlMad dot com


$0.05$
Novice

Mar 28, 2002, 12:53 PM


Views: 7920
Re: [RedRum] storing a picture file in a BLOB

thanks a lot guys

ill take a look at all that stuff right now Smile