Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 652

PHP, display image with Header()

$
0
0

I'm displaying images from outside my web root, like this:

header('Content-type:image/png');readfile($fullpath);

The content-type: image/png is what confuses me.

Someone else helped me out with this code, but I noticed that not all images are PNG. Many are jpg or gif.
And still they are displayed successfully.

does anyone know why?


Viewing all articles
Browse latest Browse all 652

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>