Menu
Hi,
I try learning finfo file function but tutorials show complications.
Eg.
[code]
$finfo = finfo_open(FILEINFO_MIME_TYPE); // return mime type ala mimetype extension
foreach (glob(“*”) as $filename) {
echo finfo_file($finfo, $filename) . “n”;
}
finfo_close($finfo);
What is **glob
I do not get that line atall!
Can someone be kind of enough to show very basic and bare min sample code instead ?
I hear finfo file is tough nut to crack and you can get the correct file type user is trying to upload to your server.
Other functions to detect file type are easily breakable.