neilwatson has asked for the wisdom of the Perl Monks concerning the following question:
My webserver is Apache running on Linux.# strict, warning and other things snipped. $posid = param('posid'); $name = param('name'); $phone = param('phone'); $email = param('email'); $resumeurl = param('resumeurl') || "none"; $resumefilename = upload('resumefile') || "none"; $resumefiletype = uploadInfo($resumefilename)->{'Content-Type'}; #check for correct file type foreach $x (@filetype){ if ($x eq $resumefiletype){ $notype++; } } if ($notype == 4) { die "Sorry we do not accept $resumefiletype files. +"; } while (<$resumefilename>){ $resumefile .= $_; } #insert into resumes $statement = "INSERT INTO resumes (appid, posid, resumefilename, resum +efiletype, resumefile, resumeurl) VALUES (?, ?, ?, ?, ?, ?)"; $sth = $dbh->prepare($statement) || die "Could not prepare statement: +".$dbh->errstr; $sth->execute($appid, $posid, $resumefilename, $resumefiletype, $resum +efile, $resumeurl) || die "Could not prepare statement: ".$dbh->errst +r;
Neil Watson
watson-wilson.ca
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI: Uploaded binary file is corrupted
by davorg (Chancellor) on Oct 30, 2002 at 15:57 UTC | |
by neilwatson (Priest) on Oct 30, 2002 at 16:09 UTC | |
|
Re: CGI: Uploaded binary file is corrupted
by iburrell (Chaplain) on Oct 30, 2002 at 17:51 UTC | |
by neilwatson (Priest) on Oct 30, 2002 at 18:15 UTC | |
|
Re: CGI: Uploaded binary file is corrupted
by jsprat (Curate) on Oct 30, 2002 at 17:22 UTC | |
by neilwatson (Priest) on Oct 30, 2002 at 17:39 UTC | |
|
Re: CGI: Uploaded binary file is corrupted
by fglock (Vicar) on Oct 30, 2002 at 17:52 UTC |