def download():
return response.download(request, db)
The form:
form = SQLFORM(table, row, deletable=True, upload=URL('default', 'download'), showid=False, buttons=buttons)
if hasattr(request.vars.image, 'filename'):
form.vars.imagefilename = request.vars.image.filename
and to process the form:
if form.process().accepted:
if row and form.vars.image__delete:
file = row.image
os.remove(os.path.join(UPLOADSDIR, 'vertex%s' % session.back_end_vertexid, file))
In web2py 2.17.2 this all worked without problem, however, after upgrading to
web2py 2.20 it no longer works. The image doesn't show in the form, it's marked
with a broken link icon, and when I click the file link I get a page not found error.
Also when I upload a new image, the old one isn't being deleted, so the images pile
up in the folder.
I hope someone knows how to solve this issue.
Kind regards,
Annet