I'd take a look at these too:
http://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets/140
http://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets/921
http://lecterror.com/articles/view/mediaview-is-a-bleeding-bastard

I usually do this with CakePHP 1.3:

vi ~/web/cake/libs/view/media.php
# go to line 112 and comment it out:
if  ($size) {
//      $id = $id . '_' . $size;
}



On 29/07/11 11:19, Meroe Kush wrote:
If i recall correctly you need to set the mimetype as well.

Add the line below and let me know if it helps.

'mimeType' =>  array('pdf' =>  'application/pdf'),

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of UprightDog
Sent: Thursday, July 28, 2011 8:08 PM
To: CakePHP
Subject: Media Views

I'm trying to get Media Views up and running, to download PDFs. I'm on
a completely new and fresh CakePHP install. This is my action:

     function download() {
         $this->autoRender = false;
         $this->view = 'Media';
         $params = array(
             'id' =>  'test.pdf',
             'name' =>  'test',
             'download' =>  true,
             'extension' =>  'pdf',
             'path' =>  APP . 'files' . DS
         );
         $this->set($params);
     }

However, the result is just a blank screen. The file definitely exists
in the right spot.

What am I missing?


--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to