in reply to Upload stuff to server
When you are uploading a file via an HTML form you can access this file using CGI.pm.
If you are creating the HTML with CGI as well, the upload field can be created like this:
Access the file like this:
If you are creating the HTML with CGI as well, the upload field can be created like this:
Usually these files are uploaded into a temoporary directory. CGI.pm deletes them automatically from the tmp dir after processing.print $query->filefield(-name=>'uploaded_file', -default=>'starting value', -size=>50, -maxlength=>80);
Access the file like this:
$filename = $query->param('uploaded_file'); $type = $query->uploadInfo($filename)->{'Content-Type'}; # or $fh = $query->upload('uploaded_file'); while (<$fh>) { print; }
|
---|
In Section
Seekers of Perl Wisdom