in reply to insert file into mysql
The Perl code is going to probably be something like this:<form action="http://www.site.com/path/to/script.pl" method=POST ENCTY +PE="multipart/form-data"> Address: <input type="text" name="address"><br> File: <input type="file" name="file"><br> <input type="submit"></form>
Although this is rather basic (and untested!!), I hope it leads to an eventual solution to your problem, of course, assuming that I am understanding it correctly :-).#!/usr/bin/perl use strict; use CGI; use DBI; my $cgi = new CGI; my $dbh = DBI->connect("DBI:mysql:dbname:localhost","username","passwo +rd"); my $fh = $cgi->upload('file'); my $data; $data .= $_ while <$fh>; my $p = $dbh->prepare("insert into `tablename` (`address`,`data`) valu +es (?,?)"); $p->execute($cgi->param('address'), $data); $p->finish; $dbh->disconnect;
--
By a scallop's forelocks!
|
|---|