Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This script will only print the contents of one file that I submit (I have submitted lots to test). Even if you re-name this one file and submit it, the contents won't print. Does anyone have any idea whats going on?? thanks, much appreciated.#! /usr/bin/perl -w use CGI; my $query = new CGI; print STDOUT $query->header(); print STDOUT $query->start_html( -title=> "CGI"); my $file = $query->upload('file'); $file =~ m/^.*(\\|\/)(.*)/; my $file_name = $2; open (FILE, "$name") or die "unable to open file"; $info = do { local $/; <FILE> }; close (FILE); print STDOUT "$info"; print STDOUT $query->end_html;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI file very odd
by hardburn (Abbot) on Jan 30, 2003 at 15:34 UTC | |
|
Re: CGI file very odd
by Jaap (Curate) on Jan 30, 2003 at 12:29 UTC | |
by Anonymous Monk on Jan 30, 2003 at 12:48 UTC | |
by Jaap (Curate) on Jan 30, 2003 at 13:46 UTC | |
by Anonymous Monk on Jan 30, 2003 at 14:19 UTC | |
|
Re: CGI file very odd
by derby (Abbot) on Jan 30, 2003 at 13:09 UTC | |
by Anonymous Monk on Jan 30, 2003 at 13:22 UTC | |
by derby (Abbot) on Jan 30, 2003 at 13:36 UTC | |
by Anonymous Monk on Jan 30, 2003 at 14:05 UTC | |
by derby (Abbot) on Jan 30, 2003 at 15:38 UTC | |
| |
|
Re: CGI file very odd
by Coruscate (Sexton) on Jan 30, 2003 at 17:38 UTC | |
by Anonymous Monk on Jan 31, 2003 at 10:12 UTC |