This should work (from T2, which deletes files by default): if form.accepts(request.vars,session): if request.vars.delete_this_record: for f in form.table.fields: if form.table[f].type=='upload' and form.table [f].uploadfield is True: name=os.path.join (request.folder,'uploads',form.record[f]) if os.path.exists(name): os.unlink(name)
Massimo On Dec 24, 10:51 am, annet <jmverm...@planet.nl> wrote: > Upon deleting a record from a table, I would like to delete the > physical uploaded file (which resides in the uploads folder) > referenced by the record. The code provided on pages 173 and 174 in > the web2py manual doesn't work. I hope one of you knows why it doesn't > work. > > Best regards, > > Annet. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---