level09 on 08/18/09
Last Edited at 08/18/09 05:24am
function force_download($file){ if ((isset($file))&&(file_exists($file))) { header("Content-length: ".filesize($file)); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="' . $file . '"'); readfile("$file"); } else { echo "No file selected"; }}
Report this snippet Tweet
Comment:
You need to login to post a comment.