Greetings,
I am trying to serve binary image data from one of my controllers.
The data comes in via xmlrpc, and as such I have access to an xmlrpc
Binary object of the image data. I've written a controller that tries
to emulate what response.download does, but it doesn't seem to work.
Can anyone point me in the right direction here:
def view():
icon_name = request.vars.name if request.vars else None
icon_name = urllib.unquote(icon_name)
if icon_name:
icon_object = bw.objectQuery("icon", icon_name)
response.headers['Content-Type'] = 'image/png'
icon_stream = cStringIO.StringIO(icon_object['icon'])
return response.stream(icon_stream, request=request);
Matt