Where $param is a value returned by $cgi->param, this is how it's done internally:
if (ref($param) && defined(fileno($param)) { is file } else { isn't }
This should also work:
if ($cgi->uploadInfo($param)) { is file } else { isn't }
You only need to check if $cgi->content_type() eq 'multipart/form-data'.
In reply to Re: Detect input type = file with CGI.pm
by ikegami
in thread Detect input type = file with CGI.pm
by manta
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |