About archer to download link
- 2012年05月18日
Though this problem since a simple event page develop work, and realized could not a good way to change the header, so the phper hacked it, here’s the code
if ($act == 'download')
{
$url = isset($_REQUEST['u']) ? $_REQUEST['u'] : exit;
//$musciname = isset($_REQUEST['n']) ? $_REQUEST['n'] : exit;
//$name = urldecode($musciname);
$ext = getExt($url);
$mod = "#^http://i\.xx\.cn/live/mp3/\d{2}/\d{2}/\d{22}\.{$ext}$#i";
if (preg_match($mod, $url) && strlen($url) == '55')
{
$name = date('YmdHis').'.'.$ext;
header("Content-Type:application/x-msdownload");
header('Content-Type:text/html;charset=gbk');
header("Content-Disposition:attachment;filename={$name}");
readfile($url);exit;
}
exit;
}
Very simple way on web server, but he missed something, the filename needs to something encode before used in web browser, but not the urldecode. If the file have space, the firefox still offer a %20 back, but IE not. Still not solved since now…
What we have now, this topic is easy to answer 1 year ago but now is impossible. There are too many choices and fallacious names post on the every standard every day. Each of them is faddish, they look audacious, and when the web designer first look those API, they think can be do everything on web browser. But after the fanatic, the most instigate service offer, like Google’s Chrome and Mozilla’s Firefox, they seems change more from this year.

