Sunday 15 April 2012

php - Passing data directly to client -


I was thinking that without collecting the image data, one could pass data directly to the customer (a particular one image) Was the method used on server disk and / or memory using the PHP Zend Framework?

I am currently doing this:

  $ data = "raw image data"; $ Type = "image / jpeg"; $ Response = $ this-> getResponse (); $ Response- & gt; Set header ('content-type', $ type, true); $ Response- & gt; Set header ('content-length', strollon ($ data), true); $ Response- & gt; Set header ('content-transfer-encoding', 'binary', true); $ Response- & gt; Set header ('cache-control', 'max-age = 3600, required-modified', true); $ Response & gt; SetBody ($ data); $ Response & gt; SendResponse (); Go out;    

You are missing out on all $ response-> SendResponse () ; Exiting before and you are good.

No comments:

Post a Comment