-5
當我從服務器下載文件時,它不給予恢復支持。PHP下載恢復支持問題
下面是代碼:
if ($zc['mm'] && $zc['mm_down'] && preg_match('/\.('.$zc['mm_ext'].')$/i', $path, $exts)) {
$file = $zc['mp3_dir'].'/'.$path;
if (file_exists($file)) {
if ($zc['stream_int']) {
$ext = strtolower($exts[1]);
zina_set_header('Content-Type: '.$zc['mm_types'][$ext]['mime']);
$disposition = (isset($zc['mm_types'][$ext]['disposition'])) ? $zc['mm_types'][$ext]['disposition'] : 'attachment';
zina_set_header('Content-Disposition: '.$disposition.'; filename="'.basename($path).'"');
zina_set_header('Content-Length: '.filesize($file));
zina_set_header('Cache-control: public'); #IE seems to need this.
zina_set_header("Content-Transfer-Encoding: binary\n");
zina_set_header('Content-Type: $contentType');
zina_send_file($file);
}
else {
zina_goto($path,NULL,NULL,TRUE,TRUE);
}
}
}
有人能幫助我如何使這個代碼簡歷可支持的。
在此先感謝。
你真的認爲全大寫的標題是合適的嗎?!除此之外,你真的需要縮進你的代碼... – ThiefMaster 2013-03-07 16:34:58
你需要處理Range頭。除非你表明你試圖解決問題,否則你在這裏得不到多少幫助。 – datasage 2013-03-07 16:37:24