'mimeType' => array('text/csv', 'csv') Try adding this above the line with $this->view = 'Media' :
Configure::write('debug', 2); See if that shows you an error. You don't need to set $this->autoLayout as MediaView will handle that. On Mon, Sep 10, 2012 at 10:05 PM, Arie Yuniarto <scs.arie...@gmail.com> wrote: > Hi all, > > I wanna ask about create a link to download file. > > so in my view i add this code > >> <?php echo $html->link('Download CSV',array( "action" => "download")); ?> > > > and then i use Media View on the controller > >> function download(){ >> >> $this->view = 'Media'; >> $params = array( >> 'id' => 'clipping.zip', >> 'name' => 'clipping', >> 'mimeType' => 'text/csv csv', >> 'download' => true, >> 'extension' => 'csv', >> 'path' => APP . 'data/csv/' . DS >> ); >> >> $this->set($params); >> $this->autoLayout = false; >> >> } > > > > but have this error : >> >> >> Error: The requested address '/somecontrollers/download' was not found on >> this server. > > > > how do i fix this?? > > -- > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com. > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com. > Visit this group at http://groups.google.com/group/cake-php?hl=en-US. > > -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en-US.