use DBI; our $dbh = DBI->connect('DBI:mysql:filemanager:localhost', 'visual', # user name 'not4you', # password { RaiseError => 1 }); my $sth= $dbh->prepare( "INSERT INTO uploadedFiles(fileType,fileName,fileSize,fileData) VALUES ( ?,?,?,?) "); open(my $fh, 'index.gif' ) or die $!; binmode $fh; #Update, added for podmaster by sporty to the example read( $fh, $var, -s $fh ); $sth->execute('image/gif','index.gif',1471,$var);