Hi, looks like your request.args(0) is empty.

понедельник, 11 ноября 2019 г., 15:37:31 UTC+5 пользователь Maurice Waka 
написал:
>
> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/d9f38307-39a9-4b1b-b126-a440a8ad8d07%40googlegroups.com.

Reply via email to