"mep" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Hi, > After lookup in cherrypy site and google for a while, I haven't > found any information about cherrypy how to serve dynamic binary > file(some generated charts).Is there any easy way to do this? > In cherrypy 2.0 & python 2.4
Yes, there is an easy way: have your handler method return the binary data, and set the Content-Type before returning the data, like this: # class Root: # def index(self): # ... Generate binary data in "data" ... # cpg.response.headerMap['Content-Type'] = 'image/gif' # return data Remi. -- http://mail.python.org/mailman/listinfo/python-list