php下载文件...
时间:2010-08-06 来源:happy664618843
function downloadFile($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 download"; } }
相关阅读 更多 +