download.php
<html>
<head></head>
<body>
<a href="1.rar">下載1.rar</a><br/>
<a href="yun.jpeg">下載圖片</a><br>
<a href="doDownload.php?filename=yun.jpeg">通過程序下載jpeg</a><br/>
<a href="doDownload.php?filename=../uploads/yun.jpeg">下載yun</a>
</body>
</html>
doDownload.php
<?php
$filename = $_GET['filename'];
header('content-disposition:attachment;filename=' . basename($filename));
header('content-length:' . filesize($filename));
readfile($filename);
?>
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者