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>
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
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 :
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