[web2py] Re: upload field value reset on form failure of another field

2011-12-05 Thread Anthony
Other form elements aren't stored in the session -- when the form submission comes in, they are in request.vars, and they can be moved to form.vars and returned with the form (no need to put anything in the session). The file itself, on the other, cannot be returned with the form, so you have t

[web2py] Re: upload field value reset on form failure of another field

2011-12-05 Thread Wikus van de Merwe
So how does it work for other form elements? I'm guessing they are stored in session. So the way to go would be to store the uploaded file in session too and then on form resubmission check what to display. If file is in session the input field should look as on update of an existing object (i.

[web2py] Re: upload field value reset on form failure of another field

2011-12-05 Thread Anthony
This is tricky. When the form is submitted, it doesn't send the location of the file on the user's computer -- it sends the actual file. Even if you knew the location of the file on the user's computer, you couldn't pre-populate the form field with that value because browsers won't allow it for