php隐藏附件的路径或地址

<?php

$url =”images/”. $_GET[‘name’];

//$url = ” http://baobao.qq.com/data/baobao_418242698_video_20080811055942.mp3″;

// 输入文件标签

$file = fopen($url,”r”);

Header(“Content-type: image/*”);

Header(“Accept-Ranges: bytes”);

//Header(“Accept-Length: “.filesize($url));

Header(“Content-Disposition: attachment; filename=” . $_GET[‘name’]);

// 输出文件内容

//echo filesize($url);

//echo fread($file);

while (!feof($file)){echo fread($file, 8192);}

fclose($file);

exit();

?>

 » 本站地址:http://www.gomoth.com

标签: