Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $this->response->setStatusCode(200);
- $this->response->setHttpHeader('Last-Modified', date('r', filemtime($file)));
- $this->response->setHttpHeader('Etag', $etag);
- $this->response->setHttpHeader('Accept-Ranges', 'bytes');
- $this->response->setHttpHeader('Content-Type', 'application/octet-stream');
- $this->response->setHttpHeader('Content-Length', filesize($file));
- $this->response->setHttpHeader('Content-Disposition', 'attachment');
- $this->response->sendHttpHeaders();
- readfile($file);
- return sfView::NONE;
Add Comment
Please, Sign In to add comment