Guest User

Untitled

a guest
Jul 17th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. <?php
  2.  
  3. $this->response->setStatusCode(200);
  4. $this->response->setHttpHeader('Last-Modified', date('r', filemtime($file)));
  5. $this->response->setHttpHeader('Etag', $etag);
  6. $this->response->setHttpHeader('Accept-Ranges', 'bytes');
  7. $this->response->setHttpHeader('Content-Type', 'application/octet-stream');
  8. $this->response->setHttpHeader('Content-Length', filesize($file));
  9. $this->response->setHttpHeader('Content-Disposition', 'attachment');
  10. $this->response->sendHttpHeaders();
  11.  
  12. readfile($file);
  13. return sfView::NONE;
Add Comment
Please, Sign In to add comment