Zend Framework: Data streaming
My understanding 开发者_如何学Gois that Zend HTTP Client is the best way to send (possibly) large files to the user; can any confirm this and show me an example? Or a better solution.
Zend_Http_Client is an advanced HTTP client which gives you the possibility to communicate with a HTTP server like a browser or other client.
It's a more advanced client like file_get_contents() or simply file().
So send data to the browser the best way is to send the data with readfile() or if you have only the binary data as a variable you can send is simply with echo.
eg.:
header("Content-Type: image/jpeg"); readfile("/path/to/the/file.jpg"); exit;
精彩评论