List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:August 6 2002 3:19pm
Subject:Re: Save Image (GIF or JPEG) file in the database ?
View as plain text  
Phoebe,

lookup load_file in chapter 6 of the manual.

Gabriel wrote:

> [crappy filter: sql, query]
>
> Phoebe Bright wrote:
>
>> Just what I wanted to do too.  But how do you actually get the 
>> contents of a
>> .JPG into the database?
>
>
>
>
> To answer your question: Read the file into memory, escape what needs to
> be escaped, and do your insert.
>
>
> But is this really the strategy you want?  Do you want the images to
> actually be in the DB, or merely referenced from the DB?  Let me 
> elaborate:
>
> On the one hand, if one stores the images in the DB, one can keep their
> mime-types, and all that there, and make lovely programs that spit out
> the images without any reliance on external filesystem access methods.
>
> But on the other hand, one would lose (or at least has a great potential
> for loss) speed this way -- Images take up lots of disk.
>
> Another method is to simply store references to the on-disk locations of
> images - it's faster, and you can do more or less all the same stuff
> that way.
>
> Lots of options. =)  Have fun!
>


Thread
Save Image (GIF or JPEG) file in the database ?Khanh Pham2 Aug
  • Re: Save Image (GIF or JPEG) file in the database ?Serge Paquin2 Aug
    • Re: Save Image (GIF or JPEG) file in the database ?Phoebe Bright6 Aug
RE: Save Image (GIF or JPEG) file in the database ?Simon Green2 Aug
  • Install innodb table type...Research2 Aug
    • Re: Install innodb table type...Victoria Reznichenko2 Aug
  • RE: Save Image (GIF or JPEG) file in the database ?Francisco2 Aug
RE: Install innodb table type...Research2 Aug
Re: Save Image (GIF or JPEG) file in the database ?Gabriel6 Aug
Re: Save Image (GIF or JPEG) file in the database ?Gerald Clark6 Aug
Re: Save Image (GIF or JPEG) file in the database ?walt6 Aug
Re: Save Image (GIF or JPEG) file in the database ?nick gatsis7 Aug