标签:
download.php 代码
<?php //获取要下载的文件名 $filename = $_GET[‘filename‘]; //设置头信息 header(‘Content-Disposition:attachment;filename=‘ . basename($filename)); header(‘Content-Length:‘ . filesize($filename)); //读取文件并写入到输出缓冲 readfile($filename);
Html调用
<a href="download.php?filename=./files/751c77c09d8e530520aab74234495f11.jpg">下载图片</a>
标签:
原文地址:http://www.cnblogs.com/99388514/p/5541290.html