//下載圖片
function downfile()
{
global $db, $smarty, $config, $segment, $admin;
$file = array_slice($segment,2,count($segment)-2);
$fileurl =implode('/',$file) ;
$info = pathinfo('http://'.$fileurl);
$file_name = $info['basename'];
$file = @ fopen('http://'.$fileurl,"r");
if (!$file) {
echo "文件找不到";
} else {
Header("Content-type: application/octet-stream");
Header("Content-Disposition: attachment; filename=" . $file_name);
while (!feof ($file)) {
echo fread($file,50000);
}
fclose ($file);
}
}app