Rodster001 has asked for the wisdom of the Perl Monks concerning the following question:
I know to set a type=text form field parameter in CGI.pm you can do it like so:
But does anyone know how to go about setting a type=file?my $cgi = new CGI; $cgi->param("my_var" => "hello there");
In CGI.pm if I access a type=file param in scalar context I get a file name, but if I treat it as a file handle I get the contents of the file. For example:
## Scalar context returns filename my $filename = $cgi->param("upfile"); ## Or... as a filehandle while (<$filename>) { ## do something with contents }
I want to set those parameters (filename and contents) so they can be accessed in the same way later. Any ideas? Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Setting a type=file parameter in CGI.pm
by kyle (Abbot) on Jan 03, 2009 at 05:38 UTC | |
|
Re: Setting a type=file parameter in CGI.pm
by hangon (Deacon) on Jan 03, 2009 at 00:36 UTC | |
|
Re: Setting a type=file parameter in CGI.pm
by Anonymous Monk on Jan 02, 2009 at 20:59 UTC | |
by Rodster001 (Pilgrim) on Jan 02, 2009 at 21:09 UTC | |
by Corion (Patriarch) on Jan 02, 2009 at 21:25 UTC | |
by Rodster001 (Pilgrim) on Jan 05, 2009 at 16:55 UTC | |
by kyle (Abbot) on Jan 05, 2009 at 17:02 UTC | |
|