Skip to content

Instantly share code, notes, and snippets.

<?php
$file = $_GET['file'];
$today = date("Ymd-His");
header("Content-type:text/csv");
header("Content-Disposition:attachment;filename=report-" . $today . ".csv");
readfile($file);
unlink($file);
?>