c has asked for the wisdom of the Perl Monks concerning the following question:
$file = $query->upload('uploaded_file'); if (!$file && $query->cgi_error) { print $query->header(-status=>$query->cgi_error); exit 0; }
This lets you do a check on the MIME type of a file being uploaded, provided that the browser passes this type of info for the file. I've tried using this syntax with both Netscape 4.7 and IE 5.5, but neither seems to pass the information. With fatalstobrowser enabled, I receive:
Can't use an undefined value as a HASH reference at /path/to/search-ho +wto.cgi line 185.
My code verbatim, is:
When I remove the uploadInfo line, the file gets uploaded properly, however its not worth it for me to remove this line. Can someone point out what I am missing?
-c
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: using uploadInfo from CGI.pm
by dws (Chancellor) on Nov 30, 2001 at 07:55 UTC | |
by c (Hermit) on Nov 30, 2001 at 11:20 UTC | |
by dws (Chancellor) on Nov 30, 2001 at 11:25 UTC | |
by Anonymous Monk on Oct 18, 2002 at 14:54 UTC | |
by pernod (Chaplain) on Mar 05, 2003 at 16:37 UTC |