tf198 has asked for the wisdom of the Perl Monks concerning the following question:
I have tried many times the very best I can but still can't seem to get this right. Please help me add the conditions mentioned above for my own personal knowledge and security.
Thank you very much for your time~
Jim
#!/usr/bin/perl use CGI qw(:standard); my $cgi = new CGI; my $upload_dir = '.'; my $file = $cgi->param('file'); my $filename = $file; $filename =~ s/^.*(\\|\/)//g; print $cgi->header(-type=>'text/html'); open(OUT, ">$upload_dir/$filename") || die print "Fail to upload: $!"; + while(<$file>) { print OUT; } close(OUT); print "$filename has uploaded\n"; __END__
20050402 Janitored by Corion: Fixed code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Question regarding basic help with my upload script
by tlm (Prior) on Apr 02, 2005 at 21:54 UTC | |
|
Re: Question regarding basic help with my upload script
by nobull (Friar) on Apr 03, 2005 at 12:24 UTC |