Could we help you? Please click the banners. We are young and desperately need the money
In this short article, we'll show how to serve files as responses in PHP.
<?php
$file = 'path/to/file';
$resource_content = file_get_contents($file);
$mime_type = mime_content_type($file);
$content_length = strlen($resource_content);
header("Content-type: {$mime_type};");
header("Content-Length: {$content_length};");
echo $resource_content;
?>