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)
--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/GbwQoJymKns/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/d9f38307-39a9-4b1b-b126-a440a8ad8d07%40googlegroups.com.
But I did upload and the image is in the folder.
return dict(img=row.fdata)
{{=IMG(_src=(URL"download", img), _alt="test image")}}
--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/GbwQoJymKns/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/6301fedd-ed05-484f-bffc-6afeb2f200cf%40googlegroups.com.
Thanks.Let me work it out.Regards