I'm trying to retrieve an uploaded image from the uploads folder using this 
<http://www.web2pyslices.com/article/show/1522/generate-a-thumbnail-that-fits-in-a-box?commentlimitby=0%2C15#comment_1419>
 
example.

I keep on being redirected back to the index page.

I also tried this option with the same result.

This is the controller code:

def showarticle():
    id = request.args(0) or redirect(URL('default', 'index'))
    article = Article[id]
    try:    
        import os
        from PIL import Image
    except: 
        return
    stream=Image.open(request.folder + 'uploads/' + id)
    return response.stream(stream, attachment=False, article=article)

How can I get this right?
Regards

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/29b39bb2-8084-41b8-b2a6-589e39aa3f92%40googlegroups.com.

Reply via email to