thanks Jonathan!
On Jul 16, 4:03 pm, Jonathan Lundell <jlund...@pobox.com> wrote: > On Jul 15, 2009, at 9:46 PM, mdipierro wrote: > > > This should do it but I have not tried it > > > db.define_table('image',Field('data','upload'),Field > > ('size','integer')) > > > def store_size(form): > > request.vars.image.file.seek(0) > > form.vars.size=len(request.vars.image.file.read()) > > > form=SQLFORM(db.image) > > form.accept(request.vars,session,onvalidation=store_size) > > def store_size(form) > request.vars.image.file.seek(0, os.SEEK_END) > form.vars.size = request.vars.image.file.tell() > > (not tested) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---