[Zope] How to set MIME types in zope

2006-12-27 Thread Sudesh soni
Forgive my ignorance, I have a question.

If I set the 'security' setting  in internet options :

'Open files based on content not file extension'   to Disable  

and the try to access a page rendered by python script then I get the following 
javascript error on the page:

"This content might not be displayed properly.The file was restricted because 
the content does'nt match its security information"

But if I enable the settings in Internet Options-->Security, ie  'Open files 
based on content not file extension'  then the above error does not occur  

There seems a conflict between the extension type set by Zope and the MIME in 
Internet Explorer as it is seeing it has a script.

How can I resolve the error , keeping the property  'Open files based on 
content not file extension'   to Disable  ?

Do I have to set the MIME types in every file or it could be set at a single 
location in some zope configuration file?

Any help would be appreciated.

Thanks
Sudesh



- Original Message - 
From: "Dieter Maurer" <[EMAIL PROTECTED]>
To: "Garito" <[EMAIL PROTECTED]>
Cc: "Lista Zope Internacional" 
Sent: Friday, October 20, 2006 12:10 PM
Subject: Re: [Zope] How to do...


> Garito wrote at 2006-10-20 14:20 +0200:
>>Dieter Maurer escribió:
>>> You remember I have warned you: "__getattr__" is difficult and error prone!
>>>
>>>Even me, I have spend hours to understand why I get occasional
>>>"__getattr__" infinite loops...
>>>And I know, in principle, all the potential caveats...
>>>
>>>   
>>Can you point me to some example/product to try to avoid this kind of 
>>errors?
> 
> It is quite difficult to learn all kinds of problems from an example.
> 
> I think I already have publicly described my "__getattr__" problems.
> Thus, you can search the mailing list archive...
> 
> An example product where "__getattr__" is used is "BTreeFolder2".
> 
> 
> -- 
> Dieter
> ___
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How to set MIME types in zope

2006-12-27 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



- --On 27. Dezember 2006 16:11:15 -0500 Sudesh soni 
<[EMAIL PROTECTED]> wrote:

> Forgive my ignorance, I have a question.
>
> If I set the 'security' setting  in internet options :
>
> 'Open files based on content not file extension'   to Disable
>
> and the try to access a page rendered by python script then I get the
> following javascript error on the page:
>
> "This content might not be displayed properly.The file was restricted
> because the content does'nt match its security information"
>
> But if I enable the settings in Internet Options-->Security, ie  'Open
> files based on content not file extension'  then the above error does not
> occur
>
> There seems a conflict between the extension type set by Zope and the
> MIME in Internet Explorer as it is seeing it has a script.
>
> How can I resolve the error , keeping the property  'Open files based on
> content not file extension'   to Disable  ?
>
> Do I have to set the MIME types in every file or it could be set at a
> single location in some zope configuration file?
>

IE's behavior is stupid and broken in many way. Not only different IE 
versions behave differently but also it depends on the Windows version.
One of the stupid errors I've encountered lately: you write a script to
generate a CSV file, you set the proper mime-type however IE does not 
recognize the response a CSV as long the URL *including* the query
string does not end with '.csv'.

- -aj
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)

iD8DBQFFk3a3CJIWIbr9KYwRAqmzAJsH0ZmqRyoI+oRguOFiiwa9ET9QrgCeMebc
J/HPU6I/N6CgmLKPNnKdOvc=
=Ks6D
-END PGP SIGNATURE-

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )