On Jun 25, 10:10 pm, Matt Wilson <[EMAIL PROTECTED]> wrote: > I'm writing a controller method that gets an image file name as a > parameter. I retrieve the image file, which can be a GIF or a JPEG, > and then I return the image. > > I need to set the content type based on the results of the image type, > so I can't set the content type in the @expose(...) decorator. > > What are my options? > > TIA > > Matt
In your controller: cherrypy.response.headers['Content-Type'] = 'image/jpeg' # or 'image/gif' --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

