The image can't be show
Posted: 21 May 2020, 10:15
HI, I install the file app,but there is something wrong.
I don't know why,so I need your help. thanksX3 Photo Gallery Support Forums
https://forum.photo.gallery/
http://52.74.97.114/ the folder have some image in it and it can't be show.mjau-mjau wrote: There is supposed to be files inside the /test/ folder? Does it show any files for ANY of the folders? Or is it always empty? I can't really diagnose from a screenshot, but looks like an error when loading the data for the folder. You can open browser developer tools > network inspector, and then click the in Files app menu and see what loads in network inspector. Then you can click the loaded items, and see if there are any errors.
If you have a link, I can check. If not, I can only guess, because I can't see what's wrong from your screenshots.
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.