Hello Reader's if you want to give output as an image then you can use the code below:-
You can use finfo (PHP 5.3+) to get the right MIME type.
$filePath = 'yourfile.ext';
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$contentType = finfo_file($finfo, $filePath);
finfo_close($finfo);
header('Content-Type: ' . $contentType);
readfile($filePath);
Note : You don't have select Content-Length, Appache will take care of it
0 Comment(s)