function file_down($filepath) {
$filetype = pathinfo($filepath, PATHINFO_EXTENSION);
$file_header = get_headers($filepath, true);
header('Pragma: public');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: pre-check=0, post-check=0, max-age=0');
header('Content-Transfer-Encoding: binary');
header('Content-Encoding: none');
header('Content-type: ' . $filetype);
header('Content-Disposition: attachment; filename="' . basename($filepath) . '"');
header('Content-length: ' . $file_header['Content-Length']);
readfile($filepath);
exit;
}