Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Is the readfile function supported?
However readfile($file); will try to read the file in order to stock it in the RAM in its entirety before sending it to the visitor - this is unnecessary and risky depending on the size of the file. Here's what to do instead:
$handle = fopen($file, "rb");
if ($handle) {
while (!feof($handle)) {
print fread($handle, 65536);
}
fclose($handle);
}
Link to this FAQ: