[web2py] Re: GAE - Rendering uploaded Blob as jpeg image rather than as a string?

2012-02-24 Thread Wikus van de Merwe
You kind of do :) There is no way to embed streams in HTML directly. You need a separate function showing a single image by id (e.g. /show_image/id) and build a list with links to that function in the list_image view. {{for img in images:}} {{= TD(img.title) }} {{= TD(IMG(_src=URL("sh

[web2py] Re: GAE - Rendering uploaded Blob as jpeg image rather than as a string?

2012-02-24 Thread Massimo Di Pierro
You have two actions: list_image() -> returns an image (always image 1?) ist_images() -> returns the html page. In the latter you can do: View: {{extend 'layout.html'}} Display Jpeg Images Image Title Image Blob {{for img in images:}} {{ =i

[web2py] Re: GAE - Rendering uploaded Blob as jpeg image rather than as a string?

2012-02-23 Thread BrendanC
OK - Quick follow up here - I was able to display an blob image using the call: def list_image(): myid = 1# test image=db(db.xim.id==myid).select(orderby=db.xim.title) response.headers['Content-Type']='image/jpeg' mystream = image.image_blob return mystream However

[web2py] Re: GAE - Rendering uploaded Blob as jpeg image rather than as a string?

2012-02-23 Thread BrendanC
I thought the content type settings were handled automatically by the framework. Anyway - for some reason setting the response.headers to 'image/jpeg' does not work - just get an empty/blank page. I must be missing something else re handling gae blob properties - here's my test code: Any furt

[web2py] Re: GAE - Rendering uploaded Blob as jpeg image rather than as a string?

2012-02-23 Thread Massimo Di Pierro
you need to set the response.header['Content-type']='image/jpeg' else the browser does not know what to do with the file. On Feb 23, 2:23 pm, BrendanC wrote: > I uploaded a small (<1mb)  jpeg image to my local dev app server. In this > case the blob goes in the image file and is stored as a la