test.html: <a rel="nofollow" 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);

}