[Zope] Displaying different files of server file-system of different format

Jerome Alet alet@librelogiciel.com
Mon, 23 Sep 2002 10:52:35 +0200


On Mon, Sep 23, 2002 at 10:41:10AM +0200, Ulla Theiss wrote:

>       3. The format of the file (pdf, html, gif, ...) is determined
> dynamically, too
> 
> Unfortunately I have nothing but problems with it. I am completely in
> the dark.
>       1. To display a file from the local file-system, I created a dtml-file
> with the
>       following contents:
> 
>       <dtml-var "localFS['tmp']['kaese.pdf']">
> 
>       The problem is, that the file is displayed in ascii-format, not in pdf.

You have to set the response's content-type header

e.g. :

   <dtml-call "RESPONSE.setHeader('Content-Type', 'application/pdf')">
   
just before returning the file's contents

hth

Jerome Alet