I have a HTML file field <input name="File" id="FileName" type="file"/>
. When I submit the form, I do receive the file, all fine. However, when I validate the user's input and cannot accept the values provided, I will need another round trip. As usual, I will redisplay the form plus error messages.
For text field
or textarea
I can set the (already) provided value, e.g. by value
or just echo
the value in the textarea. How could I do the same for file
fields? I want to avoid that the user always has to reselect the file in the browser.
-- added --
Comments below are right - there are workarounds described in the mentioned SO questions: