I have an image $file ( eg ../image.jpg )
$file
../image.jpg
which has a mime type $type
$type
How can I output it to the browser?
$file = '../image.jpg'; $type = 'image/jpeg'; header('Content-Type:'.$type); header('Content-Length: ' . filesize($file)); readfile($file);
1.4m articles
1.4m replys
5 comments
57.0k users