具体如下:
//下载
function downregcaseAction() {
$file="upload/regcase.jpg";
if(isfile($file)) {
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=".basename(file));
readfile(file);
exit;
} else {
echo "文件不存在!";
exit;
}
}
上一篇:怎么用php计算年龄