[Zope] Product function with extension

Gaël Le Mignot gael at pilotsystems.net
Sun Apr 8 12:06:20 EDT 2007


Hello Garito!

Sun, 8 Apr 2007 16:48:14 +0200, you wrote: 

 > Hi!!
 > I have a method in my product called freemind wich generate the xml to the
 > freemind applet but on this applet is mandatory to use the .mm extension

 > Is possible to create a product function with extension? (in this case will
 > be something like freemind.mm)

You could do it with a dirty setattr(self, "myfunction.mm", self.myfunction).

But I would say the cleanest way is to use the Content-Disposition  HTTP header:

         Content-Disposition: attachment; filename=myfunction.mm

(with REQUEST.RESPONSE.setHeader).

See http://www.ietf.org/rfc/rfc1806.txt for more information on it.

-- 
Gaël Le Mignot - gael at pilotsystems.net
Pilot Systems - 9, rue Desargues - 75011 Paris
Tel : +33 1 44 53 05 55 - http://www.pilotsystems.net
Hébergement Zope et Plone gratuit - http://www.objectis.org


More information about the Zope mailing list