Warning: finfo_file(): supplied argument is not a valid file_info resource in /home/collab13/public_html/testing123.php on line 5
Warning: finfo_close(): supplied argument is not a valid file_info resource in /home/collab13/public_html/testing123.php on line 6
Has anyone been through this process before? If so please let me know if you have any idea as to how to get this extension to work, it has givin me great trouble and I am considering switching to the magic mime type but do not want to give up. This is my code, the magic extension seems to be loading since that error has gone away.
Code: Select all
if (isset($_POST['submit'])){
$finfo = finfo_open(FILEINFO_MIME,'/usr/local/apache/conf/magic.mime');
var_dump($finfo);// return mime type ala mimetype extension
$mime=finfo_file($finfo, $_FILES['file']['tmp_name']);
finfo_close($finfo);
echo $mime;
}Code: Select all
<form action="" method="post" enctype="multipart/form-data" >
<input type="file" name="file" id="file" />
<input type="submit" name="submit" id="submit" value="Upload!" />
</form>