Hai friends,
I have a doubt that if we are having a page which having the functionality to upload a file, then if we want to restrict to some types of files only have to be uploaded ex:- jpg,png.... .Then i am using Apache2::Upload module in which we can get the type of file using type function.
But the users are very smart than me. They changed the extension of pdf file into jpg and they are uploading the files. This is succeeding because Apache2::Upload module will checks the file type by extension.
When i searched i got File::Type module and it working in perl file means .pl, if i wants to work same in .pm(Modperl) file then it is not working.
Can any one say why it is not working (or) is there any other module or other way to find the file type by its data, not by extension. Please help me friends.