That did it!

Thank you very much.

On Feb 11, 5:46 pm, Thadeus Burgess <[email protected]> wrote:
> For one, the formkey is generated in the session. So you can only
> submit the form once after it is generated with your session, since
> curl is not tied to your browser session formkey will not work.
>
> You need to not pass session to form.accepts and then it will work.
>
> form.accepts(request.vars)
>
> -Thadeus
>
> On Thu, Feb 11, 2010 at 4:36 PM, raven <[email protected]> wrote:
> > I tried simplifying the situation, by forgetting about the file upload
> > for now, and just posting a text string
>
> > db.define_table( 'names',
> >    Field('name', 'string' ))
>
> > def upload2():
>
> >    form=FORM(TABLE(TR("Your
> > name:",INPUT(_type="text",_name="name",requires=IS_NOT_EMPTY())),
> >                     TR("",INPUT(_type="submit",_value="SUBMIT"))))
> >    if form.accepts(request.vars,session):
> >        response.flash="form accepted"
> >        db.names.insert(name=form.vars.name)
> >    elif form.errors:
> >        response.flash="form is invalid"
> >    else:
> >        response.flash="please fill the form"
> >    return dict(form=form,vars=form.vars)
>
> > Which suggests the curl command should be
>
> > curl ^
> >  -F name=atest ^
> >  -F _formkey=fb7156e2-f6ca-43e1-a4e1-993ca4c24c26 ^
> >  -F _formname=default ^
> >  http://127.0.0.1:8000/filer/default/upload2/2
>
> > But it doesn't work!
>
> > --
> > 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 
> > athttp://groups.google.com/group/web2py?hl=en.

-- 
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.

Reply via email to