Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Checking File Typesby rob_au (Abbot) |
on Oct 10, 2002 at 03:06 UTC ( [id://204088]=note: print w/replies, xml ) | Need Help?? |
It seems that you are making more work for yourself than you rightly need to. It is for just this type of scenario that I wrote the CGI::Upload module - This module allows you to check file upload type by both contents (using File::MMagic and MIME magic numbers ) and file extension. For example, using the CGI::Upload module, this code could be reduced to the following (comments included for explanation) :
perl -e 'print+unpack("N",pack("B32","00000000000000000000000111001011")),"\n"'
In Section
Seekers of Perl Wisdom
|
|