in reply to Detect input type = file with CGI.pm
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'.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Detect input type = file with CGI.pm
by manta (Initiate) on Aug 18, 2010 at 13:07 UTC | |
by ikegami (Patriarch) on Aug 18, 2010 at 14:13 UTC |