mercredi 9 septembre 2020

PHP + htaccess. Why big pictures cannot load?

I am using htaccess redirects where all links would be redirected to mvc.php with GET parameter of required url. If mvc.php sees that url is accessed file - it returns file:

if(file_exists($path) && !is_dir($path)){
    header('Content-Type: '.$this->getContentType($path));
    include($path);
} else {
    include('../filedoesnotexist.php');
}

$this->getContentType($path) is working correctly. Small image loads okay (something about <10KB).

But if i try to load big image (for example 1920x1080) - something weird happens and browser (Chrome) instead of image shows little white square (image isnt loaded)

How can i fix it? Or i needs to create new .htaccess logic with straight redirect to file?

Image that didnt load: Image that didnt load




Aucun commentaire:

Enregistrer un commentaire