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

Hello fellow monks, i've been trying to update a blob column with an image, from a webpage, and finally suceeded...
however, only _one_ image works (?), the image is about 1062 bytes long, gif.
when i try other gifs sometimes i get half the image and jpg/png files doesn't show anything, except the image size..
$CGI::POST_MAX is set to 150kb, dbi LongReadLen set to 100kb, etc..
if i use load_file() with mysql, the images work..

(i'm using the lastest DBI/DBD::mysql, CGI modules..) -- cubik

Replies are listed 'Best First'.
Re: MySQL, BLOB, weirdness...
by tadman (Prior) on Jul 04, 2001 at 13:18 UTC
    Some code would certainly help, as well as your choice of platform. This is a common type of problem, but the causes vary wildly. Trying to diagnose a code problem without source code is like trying to fix a car when it's at home and you're at the garage telling the mechainic about a funny noise you heard coming from the engine.

    How you are inserting and retrieving the images is of particular interest. If you could post your INSERT statement, with associated DBI code, it would probably be very clear what your problem is. Also, how are you loading the file? Is it loading completely? You suggest that load_file works, and that is something internal to MySQL, so it could be that you are not reading the entire file.
Re: MySQL, BLOB, weirdness...
by cianoz (Friar) on Jul 04, 2001 at 15:03 UTC
    Please post a bit of code, it looks like a quoting problem, do you use placeholders in the insert statement? another possible issue could be the value of "max_allowed_packet" in mysqld try to put
    [mysqld] set-variable = max_allowed_packet=1M
    in /etc/my.cnf