MDCode Posted November 5, 2014 Posted November 5, 2014 Hello. According to the PHP docs for this fileinfo function(finfo_open()) at php.net, the fileinfo extensions should be automatically included in PHP 5.3.0 and newer. Stevie is currently running 5.3.8 and is returning undefined function errors on every finfo_* function. I was just wondering if you have manually disabled it or is something wrong with it?
Byron Posted November 5, 2014 Posted November 5, 2014 It's not enabled for some reason. What do you need finfo_open for? Perhaps you can accomplish what your trying to do another way? Here's a list of working functions on Stevie: http://bybyron.net/php/get_defined_functions.php
MDCode Posted November 5, 2014 Author Posted November 5, 2014 I was trying to get the mime type of files for an open source file manager I've been making. mime_content_type() is the only other way I've found that will work with files that are already on the server, but it has been deprecated for the fileinfo() functions. If it has to be disabled, that's fine. I can just work on it in xampp.
Byron Posted November 5, 2014 Posted November 5, 2014 curl should do what you want: $type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE); http://bybyron.net/php/tools/file-size.php?url=http%3A%2F%2Fmedia-cdn.tripadvisor.com%2Fmedia%2Fphoto-s%2F01%2F7c%2Fc7%2Fae%2Fseaside.jpg
MDCode Posted November 5, 2014 Author Posted November 5, 2014 Thank you for the suggestion. However, to use a cURL request on every file; especially for just the mime type, uses up a lot more resources than I would like to. I will just continue to test this project on xampp. Sorry for wasting your time.
Recommended Posts