How to manually set the Content-Type
"Wolfgang Huber" <[email protected]> Mon, 21 Mar 2011 07:18:14 +0100
| Newsgroups | gmane.comp.cms.zms.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, Somehow Zope doesn't always guess the correct ContentType and so it happens that in our System we do have many 'application/x-octet-stream' instead of 'application/pdf'. I managed now to display the right icon by reading the first four bytes of the file (if they read '%PDF' it's a pdf-file). But as this method is a rather elaborate one I would want to set the 'content_type' - property manually so that this method is only called once. How can I accomplish this? regards, Wolfgang Huber Informationsmanagement, Anwendersysteme Web Engineer Johannes Kepler Universität Altenbergerstraße 69 4040 Linz, Österreich Tel: +43 732 2468 8082 http://www.im.jku.at