You need to have a table witha BLOB column (you choose the
size of BLOB depending on the maximum size of data you want
to stuff in there.
Then, slurp your gif into a variable, and use the statement
like
$sql = "INSERT INTO BLOBTABLE (Filename, Data) VALUES (?, ?)";
my $sth = $dbh->prepare($sql);
my $result = $sth->execute($filename, $gifdata);
And to get it back, something similar... see
this
for an example.
Now, to upload the image via CGI, you need to look at file
uploads. To download it, you just need to print it to STDOUT
with the correct content type header. |