我尝试下载文件时,文件Doc中出现此错误
这是我的代码:
public function downloadAction()
{
$id = $this->getParam("id");
$req = Baseco::getBasecoById($id);
$url = 'http://'.$_SERVER['SERVER_NAME'].$this->view->baseUrl();
$chemin = $url.$req->chemin;
$type = FAR_Traitement_Fichier::getTypeFichier($req->type);
header("Content-Type: $type");
header("Content-Disposition: attachment; filename=".basename($chemin));
readfile($chemin);
// disable layout and view
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
}
感谢。