That was quite helpful jackbenimble4
It would appear after looking at my phpinfo and not finding any mention of fileinfo installed on my hosted server that fileinfo is not installed. I'm not really interested in stalling anything to my php at this point so all of my questions have been answered.
It is kind of a moot point now, but the code I used was
PHP Code:
<?php
$filename="/images/alita3.jpg";
$finfo = finfo_open(FILEINFO_MIME); // return mime type ala mimetype extension
foreach (glob("*") as $filename) {
echo finfo_file($finfo, $filename) . "\n";
}
finfo_close($finfo);
?>
and the error I received was
Code:
Fatal error: Call to undefined function: finfo_open() in /home/content/a/n/i/animeviews/html/test.php on line 3
I was under the impression that you could determine the content type of a file simply by looking at the extension, but it appears that this is not the case. When a file editor is used the extensions are displayed, but if finfo_type can determine the contents of the file using a completely different method then using a file editor or other simple folder scanning script is, well, something different.
Again, thanks for the info
Bookmarks