nickel has asked for the wisdom of the Perl Monks concerning the following question:

how would i do this?

Replies are listed 'Best First'.
Re: inputting an image into mysql with DBI
by gmax (Abbot) on Mar 28, 2002 at 13:55 UTC
Re: inputting an image into mysql with DBI
by talexb (Chancellor) on Mar 28, 2002 at 14:51 UTC
    Putting an image into MySQL through DBI can be done, however, depending on where this is hosted, you may find you aren't allowed to do it. Certainly on my web provider (pair Networks) there is an explicit notice telling users not to insert graphic data into databases -- I've just spent a couple of minutes trying to find the exact page on their site but to no avail.

    One alternative would be to store the file name of the graphic, and write a module to provide methods to get and set a graphic. That way you can change whatever method you use 'under the covers' and let the rest of your application do whatever it does.

    Update Found the link I was looking for. Read this for the limitations on pair Networks.

    --t. alex

    "Here's the chocolates, and here's the flowers. Now how 'bout it, widder hen, will ya marry me?" --Foghorn Leghorn

Re: inputting an image into mysql with DBI
by trs80 (Priest) on Mar 28, 2002 at 15:22 UTC
    For you and others seeking to do this I would encourage you to look at the MySQL mailing lists (search for 'image blob'). There are at least 3 threads in the last three years that debate the topic of whether the image should or should not be stored in the database. It really does boil down to need/want in the end, but there is some good discussion on the subject none the less.

    note: the information may or may not be Perl specific