开发者

Zend Framework: Data streaming

开发者 https://www.devze.com 2023-01-15 13:04 出处:网络
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

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;

0

精彩评论

暂无评论...
验证码 换一张
取 消