me1000 Posted February 16, 2008 Share Posted February 16, 2008 How do you get the MIME (filetype) of a file that is on your server? for example: the path of the file is /users/root/123/file.jpg so $file = '/users/root/123/file.jpg'; is there a PHP function to get the MIME info from that file? which in this case would be image/jpeg Thanks, Quote Link to comment Share on other sites More sharing options...
Chris92 Posted February 16, 2008 Share Posted February 16, 2008 mime_content_type(); Quote Link to comment Share on other sites More sharing options...
me1000 Posted February 16, 2008 Author Share Posted February 16, 2008 thank you... Quote Link to comment Share on other sites More sharing options...
me1000 Posted February 16, 2008 Author Share Posted February 16, 2008 hmmm... I am getting an undefined function error, $fileType = mime_content_type($file); Quote Link to comment Share on other sites More sharing options...
Chris92 Posted February 16, 2008 Share Posted February 16, 2008 Check the finfo_open function, I've never used it but it might be able to retrieve the same info, I'm not sure. Quote Link to comment Share on other sites More sharing options...
me1000 Posted February 16, 2008 Author Share Posted February 16, 2008 it says that function isn't defined either... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.