Please open a ticket about this. On Monday, 9 March 2020 03:42:54 UTC-7, John Bannister wrote: > > Hi All, > > Still struggling a lot with fields of type 'upload'. Whatever I try the > field remains None. Any help greatly appreciated. > > Typical use case is as follows: > > Model: > db.define_table('test', > Field('f_name'), > Field('l_name'), > Field('image', 'upload', default='test')) > > Controller: > @action('test', method=['GET','POST']) > @action.uses('generic.html', session, db, T) > def test(): > page_title = 'Test' > messages=[] > my_dict = request.query.decode() > post_vars = request.forms > form=Form(db.test) > print ('Form vars before are %s' % form.vars) > if form.accepted: > print('inside form accepted') > print ('Form vars are %s' % form.vars) > elif form.errors: > messages.append('form %s has errors: %s ' % (form.form_name, > form.errors)) > return dict(form=form, page_title=page_title, messages=messages) > > All fields/form.vars etc are okay except for image which is always None. > > All help greatly appreciated > John >
-- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/16053fc7-d2e2-4b43-8126-b926303e646d%40googlegroups.com.