Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

file upload issues!

2 views
Skip to first unread message

Rahul!!

unread,
Jun 14, 2011, 10:34:28 AM6/14/11
to beginn...@perl.org
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

Rahul!!

unread,
Jun 14, 2011, 10:22:00 AM6/14/11
to beginn...@perl.org
0 new messages