X3 Photo Gallery Support Forums
Your PHP is missing functionality to detect the MIME type of files. Files app needs to know the mime-type of a file to know what to do with it ... Is it text? image? video? Mime type for a JPG image should return "image/jpeg" for example. We can't rely on the file extensions, as that is insecure and not always correct.linker wrote:http://52.74.97.114/
function get_mime($path){
if(function_exists('mime_content_type')){
return mime_content_type($path);
} else {
return function_exists('finfo_file') ? @finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path) : false;
}
}
mjau-mjau wrote:Extensive mime type mapping
Mime type is used to detect the type of file (image, video, text etc) so that Files app knows what to do with it. Instead of extracting on server (PHP), file mime-type is now mapped from file extension, which is much faster. We use an extensive list of file extensions correctly mapped to mime type, which solves issues with misconfigured servers returning incorrect or missing mime types. New option get_mime_type (disabled by default) will force server (PHP) to extract file mime types. This is slower, but more accurate if your files have extensions that don't match the actual file type.