Search…

X3 Photo Gallery Support Forums

Search…
 
linker
Topic Author
Posts: 9
Joined: 19 Jan 2018, 05:09

The image can't be show

21 May 2020, 10:15

HI, I install the file app,but there is something wrong.
Snipaste_2020-05-21_22-11-54.png
install the GD and mbstring
Snipaste_2020-05-21_22-11-54.png (20.04 KiB) Viewed 455 times
Snipaste_2020-05-21_22-14-30.png
can't see the image
Snipaste_2020-05-21_22-14-30.png (43.2 KiB) Viewed 455 times
I don't know why,so I need your help. thanks
 
User avatar
mjau-mjau
X3 Wizard
Posts: 12290
Joined: 30 Sep 2006, 03:37

Re: The image can't be show

21 May 2020, 21:24

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.
 
linker
Topic Author
Posts: 9
Joined: 19 Jan 2018, 05:09

Re: The image can't be show

22 May 2020, 00:12

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.
http://52.74.97.114/     the folder have some image in it and it can't be show. 
 
User avatar
mjau-mjau
X3 Wizard
Posts: 12290
Joined: 30 Sep 2006, 03:37

Re: The image can't be show

22 May 2020, 00:37

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.
Image

We use the below PHP function to get the mime-type of a file. It looks like you don't have mime_content_type() or finfo_file() functions available. At least one of them is required. They should be standard.
Code
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;
  }
}
 
linker
Topic Author
Posts: 9
Joined: 19 Jan 2018, 05:09

Re: The image can't be show

22 May 2020, 04:49

Thanks for your help, it is ok now. it is so coooool.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 12290
Joined: 30 Sep 2006, 03:37

Re: The image can't be show

26 Aug 2020, 04:46

Since Files app release 0.2, file mime type will get detected automatically from file extension.
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.