Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php response image

<?php
// open the file in a binary mode
$name = './img/ok.png';
$fp = fopen($name, 'rb');

// send the right headers
header("Content-Type: image/png");
header("Content-Length: " . filesize($name));

// dump the picture and stop the script
fpassthru($fp);
exit;
?>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #response #image
ADD COMMENT
Topic
Name
3+9 =