diff --git a/config/file-remote.php b/config/file-remote.php index 4a364d0..06d6c6f 100644 --- a/config/file-remote.php +++ b/config/file-remote.php @@ -13,17 +13,18 @@ if(strpos($img, ".jpg") !== false || strpos($img, ".jpeg")){ } header("Content-Type: {$contentType}", true); - +ob_start(); if(file_exists($img)){ - $content = file_get_contents($img); + readfile($img); + die; }else{ array_pop($dirs); $localDir = implode('/', $dirs); - if(!file_exists($localDir) || is_dir($localDir)){ + if(!file_exists($localDir) || !is_dir($localDir)){ mkdir($localDir, 777, true); } $content = file_get_contents("http://pensando.mj.gov.br/{$img}"); file_put_contents($img, $content); + ob_clean(); + echo $content; } - -die($content); -- libgit2 0.21.2