mime type ogg

23 views
Skip to first unread message

dimitri pater

unread,
Feb 1, 2006, 6:46:46 AM2/1/06
to cherryp...@googlegroups.com
Hi,
I am having trouble linking to ogg files on my website, clicking on it results in viewing it as a text file (www.serpia.org/music).
The mime type in Apache is properly set up (application/ogg ogg). Has it something to do with CherryPy perhaps?

Thanks,
Dimitri

--
----
"All truth passes through three stages. First, it is ridiculed. Second, it is violently opposed. Third, it is accepted as being self-evident."
~Arthur Schopenhauer
----
Please visit dimitri's website: www.serpia.org

Sylvain Hellegouarch

unread,
Feb 1, 2006, 6:52:06 AM2/1/06
to cherryp...@googlegroups.com
Try:

cherrypy.response.headers['Content-Type'] = 'application/ogg+ogg' (CP22)
cherrypy.response.headerMap['Content-Type'] = 'application/ogg+ogg' (CP21)

Are they served via the static filter?

If so (and with CP22 only) you can add:

static_filter.content_types = {'ogg':'application/ogg+ogg'} #the key is
the extension of your files

- Sylvain

dimitri pater a écrit :


> Hi,
> I am having trouble linking to ogg files on my website, clicking on it
> results in viewing it as a text file (www.serpia.org/music

> <http://www.serpia.org/music>).


> The mime type in Apache is properly set up (application/ogg ogg). Has it
> something to do with CherryPy perhaps?
>
> Thanks,
> Dimitri
>
> --
> ----
> "All truth passes through three stages. First, it is ridiculed. Second,
> it is violently opposed. Third, it is accepted as being self-evident."
> ~Arthur Schopenhauer
> ----

> Please visit dimitri's website: www.serpia.org <http://www.serpia.org>

Uche Ogbuji

unread,
Feb 2, 2006, 10:26:17 AM2/2/06
to cherrypy-users
[apologies for top-post]

The solution is simpler than that:

import mimetypes
mimetypes.init()

somewhere before cherrypy.start() and all your file type mappings
should be picked up from Apache or your system.

See:

http://groups.google.com/group/cherrypy-users/msg/76992573e1b8bc70

-- Uche

Sylvain Hellegouarch

unread,
Feb 2, 2006, 10:31:20 AM2/2/06
to cherryp...@googlegroups.com
Right.

CherryPy might as well be doing that in:
http://www.cherrypy.org/file/trunk/cherrypy/lib/cptools.py

I don't think there is any harm doing it right?
- Sylvain

Uche Ogbuji a écrit :

dimitri pater

unread,
Feb 2, 2006, 11:19:48 AM2/2/06
to cherryp...@googlegroups.com
Thank you both for your replies, I will try to get it working. First, the CP2.2 thing I'm struggling with (see other post).
thanks,
Dimitri

On 2/2/06, Sylvain Hellegouarch <s...@defuze.org> wrote:

Right.

CherryPy might as well be doing that in:
http://www.cherrypy.org/file/trunk/cherrypy/lib/cptools.py

I don't think there is any harm doing it right?
- Sylvain

Uche Ogbuji a écrit :
> [apologies for top-post]
>
> The solution is simpler than that:
>
> import mimetypes
> mimetypes.init()
>
> somewhere before cherrypy.start () and all your file type mappings
Reply all
Reply to author
Forward
0 new messages