why not using the new response class?
http://book.cakephp.org/2.0/en/controllers/request-response.html#cakeresponse
since mediaview will be deprecated in 2.3 anyway?
Am Mittwoch, 12. September 2012 06:40:31 UTC+2 schrieb jeet bajaj:
>
> Might be it download() function is looking for the
> app\views\yourcontroller\download.ctp (view file) and download function
> don't have that.
>
> try to put $this->autoRender = false; and check what happens.
>
> function download(){
>>
>
>
>> * $this->autoRender = false; *
>
>
>> $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;
>>
>> }
>
>
>
>
>
>
> On Tue, Sep 11, 2012 at 1:23 PM, Yasir Arafat Hasib
> <[email protected]<javascript:>
> > wrote:
>
>>
>>
>> On Tue, Sep 11, 2012 at 11:25 AM, Yasir Arafat Hasib
>> <[email protected]<javascript:>
>> > wrote:
>> Yes
>>
>>
>>> Hello
>>>
>>> Check the link i think this will help you
>>>
>>> <http://goog_607077148> <http://goog_607077148>
>>> http://arafats.info/cakephp-download-media/
>>>
>>>
>>>
>>> On Tue, Sep 11, 2012 at 8:05 AM, Arie Yuniarto
>>> <[email protected]<javascript:>
>>> > 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 [email protected]<javascript:>
>>>> .
>>>> To unsubscribe from this group, send email to
>>>> [email protected] <javascript:>.
>>>> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> *Thanks & Regards.
>>>
>>> -----------------------------------------------------------------------------------------------------------------------------
>>> Yasir Arafat (Hasib)*
>>> *Deputy Project Manager, *Software Solutions
>>> Grameen Solutions
>>> Contact Information:
>>> **
>>> **
>>> Cell : +8801816 536 901, +880197 *333* 2 888
>>> Web: http://arafats.info
>>> <http://arafats.info>
>>>
>>>
>>
>>
>> --
>> *Thanks & Regards.
>>
>> -----------------------------------------------------------------------------------------------------------------------------
>> Yasir Arafat (Hasib)*
>> *Deputy Project Manager, *Software Solutions
>> Grameen Solutions
>> Contact Information:
>> **
>> **
>> Cell : +8801816 536 901, +880197 *333* 2 888
>> Web: http://arafats.info
>> <http://arafats.info>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> To unsubscribe from this group, send email to
>> [email protected] <javascript:>.
>> 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 [email protected].
To unsubscribe from this group, send email to
[email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.