IIRC, you can use db.table.field.store(request.vars.field) to get the web2py generated filename.
On Nov 24, 2:53 pm, Thadeus Burgess <thade...@thadeusb.com> wrote: > The problem is I am trying to get the file from the function in > SQLFORM.onvalidation... and this happens before the file gets renamed or > saved to the disk. The only way i see of accomplishing this is > > if form.accepts(request.vars, session, dbio=False): > > #def is_plugin_archive(form) > #import tarfile, os > #path = os.path.join(db._folder, '..', 'uploads', > form.vars.file_newfilename) > > #if not tarfile.is_tarfile(path): > #form.errors.file = "Not a valid tar archive" > > is_plugin_archive(form) > > if not form.errors: > session.flash = "Version uploaded." > redirect(URL(r=request, f='plug', args=plugin.id)) > else: > response.flash = "There were errors with the file" > > elif form.errors: > response.flash = "There were errors" > > -Thadeus > > On Mon, Nov 23, 2009 at 9:46 PM, mr.freeze <nat...@freezable.com> wrote: > > ieve it is form.vars.<upload_field>_newfilename. You should be > > able to get the path > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" 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 -~----------~----~----~----~------~----~------~--~---