Welcome Guest, Not a member yet? Register   Sign In
Grabbing file mime type using CI's mimes.php file
#1

[eluser]kanuj[/eluser]
Hi there. I've a few files in a folder that I'd like to read, and match whether there mime types are of the files I'd like to read. Can I achieve this and somehow match this with CI's mimes.php file? Installing the Fileinfo PECL module is not an option.

Thanks.
#2

[eluser]xwero[/eluser]
why not use the php mime_content_type function. It is deprecated but if it's on your server why not use it.
#3

[eluser]kanuj[/eluser]
Thanks xwero, but I wish to match that mime type with the mime types in CI's mimes.php file.
#4

[eluser]xwero[/eluser]
the upload class is_allowed_filetype method is where the mime type gets checked. See how it works and adapt it for your needs.
#5

[eluser]kanuj[/eluser]
Thanks, that worked.




Theme © iAndrew 2016 - Forum software by © MyBB