1<?php
2$name = './img/ok.png';
3$fp = fopen($name, 'rb');
4
5header("Content-Type: image/png");
6header("Content-Length: " . filesize($name));
7
8fpassthru($fp);
9
1<?php
2// open the file in a binary mode
3$name = './img/ok.png';
4$fp = fopen($name, 'rb');
5
6// send the right headers
7header("Content-Type: image/png");
8header("Content-Length: " . filesize($name));
9
10// dump the picture and stop the script
11fpassthru($fp);
12exit;
13?>
14