Hi,
looking at the source code of media.php. I guess you can define
additional mimetypes in controller action which uses media view. Just
define your mime types array and set it to the view using $this->set
('mimeType', $myAdditionalMimeTypes); . These will be merged in render
function with the default ones defined in media.php.
Hope that helps.
On 24. Nov 2008, 16:50 h., sotin <[email protected]>
wrote:
> Using cake version 1.2.0.7692 RC3 it does not appear that the
> MediaView class pays any attention to the apache mime types (nor
> should it since this would be web server specific). Acceptable mime
> types in cake are hard coded in cake/libs/view/media.php. Even with
> the .xlsx extension defined (using AddType) in Apache the cakemedia
> view will not allow downloads of this file extention until the
> extension is added into the $mimeType array in themedia.php file.
>
> Is there another way to add mime types aside from extending this
> class? Maybe this could become a feature request ticket?
>
> Thanks!
>
> On Nov 24, 10:43 am, sotin <[email protected]> wrote:
>
> > Posted as a reply athttp://book.cakephp.org/view/489/Media-Views
>
> > 2 - Acceptable MIME types are declared in web server
>
> > For Apache the acceptable MIME types are given in [apache root]\conf
> > \mime.types or alternatively you can specify in [apache root]\conf
> > \httd.conf with AddType directive; e.g.
>
> > AddType application/vnd.openxmlformats xlsx
>
> > On Nov 24, 9:55 am, sotin <[email protected]> wrote:
>
> > > I originally posted this question in the CakePHP documentation but
> > > have moved it here for further discussion....
>
> > > 1 - Modify acceptable mime types?
>
> > > What is the best way to add an mime type to the 'acceptable' mime
> > > types list? I haven't been able to find anything aside from editing
> > > cake\libs\view\media.php, which I do not want to do for obvious
> > > reasons. Extending the MediaView class also seems a little excessive
> > > just to add one mime type.
>
> > > I am trying to add xlsx download support (application/
> > > vnd.openxmlformats)
>
> > > Thanks!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---