On Sunday, May 20, 2012 10:22:02 AM UTC-4, sebastian wrote:
>
> Hi All,
>
> if a form has some file upload fields, and some field validation then when 
> the form is submitted with some field not valid (such as mandatory field 
> not filled up), then the form will display the usual red message (as it 
> should), keeping all the values of the form as entered by the user except 
> for the files upload. Therefore the user is *forced* to upload the files 
> again...
>
> Is it working as designed ?
>

For security reasons, the browser will not allow the reference to the file 
on the user's filesystem to be retained in the form upload widget, so the 
user will have to re-select the file for upload. Alternatively, web2py 
could keep the originally uploaded file on the server and simply not 
require the user to re-select and re-upload the file, but that could get a 
bit complicated to implement (e.g., what happens to the orphaned file if 
there is no subsequent successful submission?).

Anthony

Reply via email to