|The stupid question is the question not asked|
Re: File uploading methods comparedby mlh2003 (Scribe)
|on May 14, 2005 at 13:49 UTC||Need Help??|
It is more secure to use CGI.pm's upload() method to create a filehandle and read from that filehandle than to create a filehandle from user-supplied data in a file upload field. Therefore, it is recommended to use the latter code snippet.
The link that explains this in more detail is here.
Also, you can set the $CGI::POST_MAX and $CGI::DISABLE_UPLOADS to specify the maximum bytesize of a file that can be uploaded and to enable/disable file uploads, respectively. The link above contains information on those variables as well.
Code is untested unless explicitly stated