If you're sending unique data for each request, I wouldn't bother using the MediaView. Just output data in your views and set some custom headers.
You can also find out about an easier way to gzip output in cakephp here: http://debuggable.com/posts/issues-with-output-buffering-in-cakephp:480f4dd5-b4fc-42a7-a5ab-4544cbdd56cb Cheers, Adam On Jan 4, 2:15 pm, ace2600 <[email protected]> wrote: > Hi, > > I want to return unique compressed XML for each user request. > Something like this in the controller: > > public function download() > { > $filename = 'some_temporary_file_name.gz'; > $this->view = 'Media'; > $params = array( > 'id' => $filename, > 'name' => 'some_temporary_file_name', > 'download' => true, > 'extension' => 'gz', > 'path' => '' > ); > > // open file for writing with maximum compression > $zp = gzopen($filename, "w9"); > // write string to file > gzwrite($zp, $unique_xml_here); > // close file > gzclose($zp); > > } > > How can I create a unique file for each request and have the file be > deleted after the user downloaded it? I'm mostly concerned with the > deleting part unless there is a convenient CakePHP for the unique file > part. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
