c has asked for the wisdom of the Perl Monks concerning the following question:
## cgi.pm parameters use CGI; #use CGI::Carp qw(fatalsToBrowser carpout); $CGI::DISABLE_UPLOADS = 0; $CGI::POST_MAX = 24000; my $query = new CGI; $query = CGI->new(); my %formdata; my @formfields = $query->param; for my $field(@formfields) { $formdata{$field} = $query->param($field); } print <<FORM; <center> <form method="post" action="https://www.$domain/$self" enctype="multip +art/form-data"> <input type="hidden" name="mod" value="on"> <input type="file" name="upload" size="40"><p> <input type="image" src="$images/submitbutton.gif"> </form> </center> FORM ## end upload documents ## while(<$formdata{upload}>) { print; }
This is just a snippet of my code. It seems to upload the file, however when a user selects C:\somefile.txt, the while statement just prints out this same path, minus the backslash. Based on Mr. Stein's code on p153 of his book with an example of how to print a file out to a local file on the server, I had thought the above snippet would work.
Can someone please point me straight?
humbly -c
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Uploading files using cgi.pm
by AidanLee (Chaplain) on Nov 29, 2001 at 19:39 UTC | |
by c (Hermit) on Nov 29, 2001 at 20:13 UTC | |
|
Re: Uploading files using cgi.pm
by cfreak (Chaplain) on Nov 29, 2001 at 22:17 UTC | |
|
Re: Uploading files using cgi.pm
by cLive ;-) (Prior) on Nov 30, 2001 at 01:04 UTC | |
by c (Hermit) on Nov 30, 2001 at 01:59 UTC |