in reply to How does file uploading work in multipart form?
The CGI.pm documentation tells us that the filename returned doubles as a file handle, so you can directly read from that parameter. This is some magic that best works when not looked closely at :). The documentation then goes on recommending the upload() function, available since version 2.47 :
$fh = $query->upload('uploaded_file'); while (<$fh>) { print; }
Using upload() gives you the additional advantage of returning an array of filehandles if there are many upload fields with the same name.
|
|---|