php response image

Solutions on MaxInterview for php response image by the best coders in the world

showing results for - "php response image"
Cristina
24 Jul 2016
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
Carolina
29 Jul 2017
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