Re: File selected for upload is cleared when page validation fails [T5.4]
On 12/06/2014 06:21 PM, Howard Lewis Ship wrote: > It's a very deliberate security design implement by all browsers otherwise > a invisible hidden form field could read any file on your filesystem Yes you are completely right. Note to self: don't ask question if you are too tired to think Kind regards, Martijn > > On Friday, December 5, 2014, Thiago H de Paula Figueiredo < > thiag...@gmail.com> wrote: > >> On Fri, 05 Dec 2014 16:41:55 -0200, martijn.list >> wrote: >> >> Hi, >>> >> >> Hi! >> >> I have a form which contains an Upload component and some other fields. >>> >>> If I select a file for upload and submit the form and the page >>> validation fails (for example because I forgot to fill in some required >>> field), the selected file is no longer selected. >>> >>> Is this by design? The other fields are retained on a validation error. >>> >> >> This is how HTML's works. It doesn't allow you to give >> it an initial value. >> >> -- >> Thiago H. de Paula Figueiredo >> Tapestry, Java and Hibernate consultant and developer >> http://machina.com.br >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> > -- CipherMail email encryption Open source email encryption gateway with support for S/MIME, OpenPGP and PDF messaging. http://www.ciphermail.com Twitter: http://twitter.com/CipherMail - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: File selected for upload is cleared when page validation fails [T5.4]
Martijn, For most common scenarios the best fix is to do sufficient validation on the client (JavaScript) that the server side validation is not likely to fail. Going further, you could store the uploaded file *before* the validation fails, and then only display the file's name, rather than the input type=file element, when displaying the form with validation errors. You may find that these scenarios are handled much better in Ajax-based file upload approaches, such as the Fine File Uploader (formerly Valums). There are Tapestry integrations, such as https://github.com/FineUploader On Dec 5, 2014 1:42 PM, "martijn.list" wrote: > Hi, > > I have a form which contains an Upload component and some other fields. > > If I select a file for upload and submit the form and the page > validation fails (for example because I forgot to fill in some required > field), the selected file is no longer selected. > > Is this by design? The other fields are retained on a validation error. > > I'm Using Tapestry 5.4b22 > > Kind regards, > > Martijn Brinkers > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: File selected for upload is cleared when page validation fails [T5.4]
It's a very deliberate security design implement by all browsers otherwise a invisible hidden form field could read any file on your filesystem On Friday, December 5, 2014, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Fri, 05 Dec 2014 16:41:55 -0200, martijn.list > wrote: > > Hi, >> > > Hi! > > I have a form which contains an Upload component and some other fields. >> >> If I select a file for upload and submit the form and the page >> validation fails (for example because I forgot to fill in some required >> field), the selected file is no longer selected. >> >> Is this by design? The other fields are retained on a validation error. >> > > This is how HTML's works. It doesn't allow you to give > it an initial value. > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com @hlship
Re: File selected for upload is cleared when page validation fails [T5.4]
On Fri, 05 Dec 2014 16:41:55 -0200, martijn.list wrote: Hi, Hi! I have a form which contains an Upload component and some other fields. If I select a file for upload and submit the form and the page validation fails (for example because I forgot to fill in some required field), the selected file is no longer selected. Is this by design? The other fields are retained on a validation error. This is how HTML's works. It doesn't allow you to give it an initial value. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
File selected for upload is cleared when page validation fails [T5.4]
Hi, I have a form which contains an Upload component and some other fields. If I select a file for upload and submit the form and the page validation fails (for example because I forgot to fill in some required field), the selected file is no longer selected. Is this by design? The other fields are retained on a validation error. I'm Using Tapestry 5.4b22 Kind regards, Martijn Brinkers - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org