X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetlab%2Fnodes%2Fnode_downloads.php;h=d43ada614868d0edfd1935a5a8f9650a7e4c51d2;hb=36e2ffa157430396d5d8a477bf2a5aa3facea6d4;hp=2577c56b83f8f490cc5a56be79bbd643dd660f47;hpb=b1b303017a2540a3883d1d45e9e78f8573f70621;p=plewww.git diff --git a/planetlab/nodes/node_downloads.php b/planetlab/nodes/node_downloads.php index 2577c56..d43ada6 100644 --- a/planetlab/nodes/node_downloads.php +++ b/planetlab/nodes/node_downloads.php @@ -59,9 +59,11 @@ function deliver_and_unlink ($filename) { 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 ?