Thanks for the hint mr.freeze - I was actually doing the opposite!
This was my function:
def test_upload():
form = SQLFORM.factory(
Field('script', 'upload', requires=IS_NOT_EMPTY()),
)
if form.accepts(request.vars, session):
response.flash = str(request.vars.script_newfilename)
return locals()
Which meant response.flash was always 'None' because I needed to use
form.vars.script_newfilename instead.
On Sep 2, 4:28 pm, "mr.freeze" <[email protected]> wrote:
> It works for me with 1.66.2. Are you possibly trying to access
> form.vars before calling form.accepts? I don't think form.vars is
> populated until after calling it.
>
> On Sep 2, 12:26 am, Richard <[email protected]> wrote:
>
> > I am using a SQLFORM.factory and the file is being saved to uploads/,
> > but that field is empty.
> > Is this functionality still only in trunk?
>
> > Richard
>
> > On Aug 27, 6:04 pm, mdipierro <[email protected]> wrote:
>
> > > This should not be. Please check for spelling errors.
>
> > > On Aug 27, 2:32 am, Richard <[email protected]> wrote:
>
> > > > with 1.66.2 <fieldname>_newfilename is returning None from my upload
> > > > field.
> > > > Has anyone else experienced this?
>
> > > > Richard
>
> > > > On Aug 16, 6:30 pm, weheh <[email protected]> wrote:
>
> > > > > OK, by getting from the trunk the gluon/sql.py and gluon.sqlhtml.py
> > > > > files, this problem is fixed in the 1.65.11 release. Thank you Massimo
> > > > > and Yarko. On to my next adventure.
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---