Re: How to manually set the Content-Type

Sebastian Tänzer <[email protected]> Mon, 21 Mar 2011 09:41:00 +0100
Newsgroups gmane.comp.cms.zms.devel
Message-ID <[email protected]>
Hello Wolfgang,

without any further details how you'd like to set the content type (i.e. in a python script, dtml method etc.) I can only provide this:

<dtml-call "RESPONSE.setHeader('Content-Type','text/xml; charset=utf-8')">

With this we set the content type in dtml-methods that return for example a CSS file.
I know this won't help a lot with uploading files.

Mit freundlichen Grüßen
Sebastian Tänzer

-
tänzermedien GmbH - Agentur für Online-Medien
Kekuléstr. 39 | 53115 Bonn, Germany

Planung und Entwicklung digitaler Medien | Internetauftritte
Webanwendungen | Content Management Systeme | Hosting

E-Mail: [email protected]  | Web: http://www.taenzer.me 
Tel.: 0228-304134-0  | Fax.: 0228-304134-99

Am 21.03.2011 um 07:18 schrieb Wolfgang Huber:

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



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/zms-developers/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/zms-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/