Baz has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl use strict; use CGI; my $query = new CGI; my $dir = $query->param('dir'); my $file = $query->param('file'); $file =~m/^.*(\\|\/)(.*)/; my $name = $2; my $error; #open(LOCAL,">$dir/$name") or $error = $!; open(UP_FILE,">$name") or $error = $!; while(<$file>) { print UP_FILE $_; } print $query->header(); print $query->start_html("File Upload"); # DEBUG TO SCREEN print $query->br,$error,$query->br,$file,$query->br,$name; print $query->end_html;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File upload and directory permissions
by dsheroh (Monsignor) on May 10, 2002 at 20:07 UTC | |
|
Re: File upload and directory permissions
by deekoo (Initiate) on May 11, 2002 at 09:49 UTC |