sub addNews {
my $self = shift;
my $file = param('new_pic'); #this is a Image File
undef $file_cont;
binmode $file;
binmode $file_cont;
while (<$file>){
$file_cont .= $_;
}
my $sql = "INSERT INTO sys_news
SET Image= ". $self->{SQL}->quote($file_cont).", CreateDate=NOW()";
$self->{SQL}->do($sql); # this means $dbh->do($sql);
}
You can save a picture inside a DB but as several threads here suggest its usually better to save the PATH to the image file instead. Try using the search function to find some of those old threads.
__________________
Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.