i think it's dillema in here
if request.vars.image != None:
# this work when the image is there, can't work if the image is empty
(leave blank), it return an error traceback said : AttributeError: 'str'
object has no attribute 'filename'
if request.vars.image:
# this work when the image is blank
no need to store the original filename
record = db(db.mytable.id==1).select().first()
filename, file = db.mytable.uploadfield.retrieve(record.uploadfield)
A('%s'%filename, _href = URL(request.application, 'default',
'download', args = [record.uploadfield]))
On Jan 14, 9:29 am, cjrh wrote:
> bump
bump
On Jan 12, 5:57 pm, carlo wrote:
> if request.vars.image!=None ## always True
>
> should be
>
> if request.vars.image
I changed the book recently, on the basis of this issue on the web2py
Google Code site:
http://code.google.com/p/web2py/issues/detail?id=110&can=1&q=image
If you have further in
4 matches
Mail list logo