无法打开流:HTTP请求失败! HTTP / 1.1 500内部服务器错误

时间:2015-04-15 08:04:11

标签: php zend-framework

我尝试下载文件时,文件Doc中出现此错误  enter image description here

这是我的代码:

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);
}

感谢。

0 个答案:

没有答案