Re: Update: HTTP_Download

From: Date: Tue, 30 Sep 2003 07:55:40 +0000
Subject: Re: Update: HTTP_Download
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-22200@lists.php.net to get a copy of this message
Michael Wallner wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, now, some tests later: 1) No gzip implemented. Browsers do weird things if output_handler is ob_gzhandler or zlib.output_compression is enabled. IE kinda hangs and Mozilla saves already gzipped files as files gzipped 2 times including a CRC Error. Furthermore we would have to read the whole file into memory if we want to gzip it by ourself. Sorry Tomas (or got any idea?). 2) Sending raw data ie. from DB BLOBs implemented. Thanks to Jeroen for this idea.
Hi Michael, Thanks for implementing my idea :-) Can I suggest a slightly different implementation of the setData function? /** * Set data for download * * @access public * @return void
   * @param    $data   raw data to send
*/ function setData(&$data){
       $this->_data =& $data;
       $this->_size = strlen($data);
       $this->_send_raw_data = true;
} I'm using references, because sometimes you want to pull a 50MB (or bigger) file from the database and you don't want PHP to internally copy this data. $data is now mandatory, which seems fine because why would anybody use setData(null). Perhaps there could be a method called unsetData to clear any raw data in the object if this functionality is needed. Please let me know what you think of this. Jeroen

« previous php.pear.dev (#22200) next »