test.html:
<a href="do.php?ac=dw">下载12.jpg</a>

do.php:
if($_GET['ac']=='dw') {

$file = './12.jpg'; //文件路径$filename = basename($file); //要下载文件的名字header("Content-Type: application/force-download");header("Content-Disposition: attachment; filename=".($filename));readfile($file);

}