Salut,
Je cherche à modifier l'entete http d'une page...
j'appelle la page http://monsite.com/member/download-file
application/controllers/MemberController.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
<?php
class MemberController extends Zend_Controller_Action {
/* ... */
function downloadfileAction() {
$dir = "/path/to/files/";
$file = "filename.ext";
$this->view->file = $dir.$file;
header("Content-Type: $mimetype; filename=$file");
}
} |
application/views/member/download-file.phtml
1 2 3
|
<?php
readfile($this->file); |
malheureusement, ça ne marche pas... j'ai cette erreur
Uncaught exception 'Zend_Controller_Response_Exception' with message 'Cannot send headers; headers already sent
Partager