rhowerton has asked for the wisdom of the Perl Monks concerning the following question:
The output I get is:#!/usr/bin/perl $DEBUG = 0; ######## use CGI; $query = new CGI; ######## $type = 'something/else'; print $query->header(); $ERROR = $query->cgi_error; $fh = $query->upload('$filename'); $filename = escapeHTML($query->param('attfile')); $type = $query->uploadInfo($filename)->{'Content-Type'}; unless ($type eq 'text/html') { die "HTML FILES ONLY!"; } if (!$fh) { print_html($ERROR); exit 0; } else { print_html("The file was of type ", $type); } if($DEBUG == 1) { @Everything = <$fh>; print_html(@Everything); } sub print_html { @String_To_Use = @_; $SizeOfArray = $#_; $Count = 0; print $query->start_html(); print "<CENTER>\n"; while($Count <= $SizeOfArray) { print "$String_To_Use[$Count]\n"; print "<BR>\n"; $Count++; } print "</CENTER>\n"; print $query->end_html(); }
The file that I'm inputting, ie the filefield is C:\filename.txt<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=windows-1252 +"></HEAD> <BODY></BODY></HTML>
Any help is greatly appreciated.
Thanx
Ryan Howerton
Edit 2001-03-13 by tye to remove <PRE>.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Reading a File Uploaded to a cgi script
by stephen (Priest) on Mar 13, 2001 at 22:57 UTC | |
|
Re: Reading a File Uploaded to a cgi script
by mr.nick (Chaplain) on Mar 13, 2001 at 22:55 UTC | |
by rhowerton (Novice) on Mar 13, 2001 at 23:50 UTC | |
|
Re: Reading a File Uploaded to a cgi script
by howard40 (Beadle) on Mar 13, 2001 at 22:56 UTC | |
|
Re: Reading a File Uploaded to a cgi script
by cei (Monk) on Mar 13, 2001 at 23:47 UTC | |
by rhowerton (Novice) on Mar 13, 2001 at 23:53 UTC | |
|
Re: Reading a File Uploaded to a cgi script
by rhowerton (Novice) on Mar 13, 2001 at 23:51 UTC |