PHP Fatal error: Allowed memory size of
157286400 bytes exhausted (tried to allocate
92702721 bytes) in /var/www/html/planetlab/nodes/node_downloads.php on line 63
header ("Pragma: hack");
header ("Cache-Control: public, must-revalidate");
- // outputs the whole file contents
- print (file_get_contents($filename));
-
+ // turn off output buffering
+ ob_end_flush();
+ // outputs the whole file contents without copying it to memory
+ readfile($filename);
+
// unlink the file
if (! unlink ($filename) ) {
// cannot unlink, but how can we notify this ?