Thanks a lot. Hard to realize after java that string and bytes can be the same :) I will think about which approach is better, Probably saving files in public area might be also a good idea
On Oct 1, 7:51 pm, Jose Galvez <[EMAIL PROTECTED]> wrote: > I've done this lots of times, especially for dynamically generated > images. The steps I usually follow are: > 1) get your binary data into StringIO, > 2) set your content type to the correct header > (response.headers['Content-type'] = 'image/jpeg' > 3) return the binary data (return STringIO.StringIO.getvalue() > > I've got example code I could send you if you need something more concrete > Jose > > mickolka wrote: > > Hi all > > > I'm quite new to pylons and have a following task. I need to return a > > content of the JPEG image file from the Pylons controller, what is a > > best way of doing it. I have not found in dos how to deal with > > binaries in response, seems like WSGIResponse supports only text > > content. > > > In general the task is to create a controller that will resize images > > availiable on the file system on demand providing thumbnails. I'm > > going to use PIL for this the only problem for me is how to return > > result to user, whould be great to hear if someone was solving similar > > problem in the past. > > > Regards, Mykola --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---