in reply to How do I enter and retrieve a GIF File from mysql via CGI?

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.

Replies are listed 'Best First'.
RE: Answer: How do I enter and retrieve a GIF File from mysql via CGI?
by perl (Novice) on Jul 05, 2000 at 20:55 UTC
    and that content-type header is:

    Content-type: image/gif

    perl