file_get_contents or readfile for displaying filesystem image

前端 未结 5 1196
栀梦
栀梦 2020-12-14 21:29

Can anyone advise on what is the best PHP function for displaying an image stored in a filesystem - file_get_contents or readfile. We are switching

5条回答
  •  心在旅途
    2020-12-14 22:24

    I should use fpassthru Using fopen you can handle errors more precisely.

    PS: be sure, that your direct output from filesystem is not vulnerable!

提交回复
热议问题