Hi All,

Actually I am trying to store the file a user has uploaded through web-
page to database. But its not getting updated fully and it's showing
only few bytes. Point here is user will upload exe or dll and I have
to store it in DB. I am highlighting the code snippet,


//WEB PAGE CODE
<form method=post ENCTYPE="multipart/form-data">
<input type=hidden name=type value="application/octet-stream">
<b>Path to file:</b><br>
<input type=file name=data size=60><br><br>

<b>Description</b>:<br>
<input name=description size=60><br><br>
<input type=submit value="Submit">
</form>

# CGI code to insert data
 my $mimetype = $cgi->param('type');

$dbh->do"insert into req_attachments"
            . " (filename, description, mimetype, submitter_id,
thedata)"
            . " values"
            . "("
                . $dbh->quote($fname) . ", "
                . $dbh->quote ($description) . ", "
                . $dbh->quote($mimetype) . ", "
                . login_to_id($user->login) . ", "
            . $dbh->quote($cgi->param('data')) . ")");

Please let me know if I am doing something is wrong here
-Rahul


-- 
To unsubscribe, e-mail: beginners-cgi-unsubscr...@perl.org
For additional commands, e-mail: beginners-cgi-h...@perl.org
http://learn.perl.org/


Reply via email to