weihe has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl use CGI; $co = new CGI; if (!$co->param()) { print $co->header, $co->start_html('CGI File Upload Example'), $co->center ( $co->br, $co->center($co->h1('CGI File Upaload Example')), $co->start_multipart_form, $co->filefield(-name=>'filename', -size=>30), $co->br, $co->submit(-value=>'upload'), $co->reset, $co->end_form ), $co->hr; }else{ print $co->header, $co->start_html('CGI File Upload Example'), $co->center($co->h1('CGI File Upload Example')); $file = $co->param('filename'); @data = <$file>; foreach (@data){ s/\n/<br>/g; } print $co->center($co->h2("Here's the contents of $file...")), "@data"; } print $co->end_html;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: upload image with cgi
by grep (Monsignor) on Sep 27, 2006 at 05:46 UTC | |
|
Re: upload image with cgi
by Praveen (Friar) on Sep 27, 2006 at 05:41 UTC | |
by Anonymous Monk on Mar 03, 2016 at 04:30 UTC |