in reply to PHP through PERL
Oh for chrissake. With a newish version of CGI.pm (version 2.47+, you do:
and with older versions, you do:$fh = $query->upload('FILE'); while (<$fh>) { $filecontents .= $_; }
In both cases the contents of the file end up in $filecontents and can be printed to a local file or worked on directly or whatever.my $file = $query->param('FILE'); my ($bytesread,$buffer,$filecontents); while ($bytesread = read($file,$buffer,1024)) { $filecontents .= $buffer; } undef $bytesread; undef $buffer;
--
Regards,
Helgi Briem
helgi AT decode DOT is
|
|---|