Well here is the deal. I have multiple HtmlInputFile controls on a single
form. I also have other input controls on the form. In my validation
routine, I check to see if the user checked a checkbox control to overwrite
existing files. If it is not checked, I verify that the filenames of the
files the user elected to upload are not the same as files in the upload
directory. If they are the same, I put a descriptive error message on the
page that identifies which file is exsiting and what action to take.
However, since the HtmlInputFile control does not retain its selected file
during postback, the user has to reselect all of the files he wants to
upload in order to to resubmit the form.
I was hoping that I could use the multiple file upload approach as opposed
to a single upload but this issue removes any advantage if the user has to
reselect multiple files each time there is a postback.
Thanks for your feedback though.
David
"CJ Taylor" <no****@blowgoats.com> wrote in message
news:10*************@corp.supernews.com...
HtmlInputFile does a lot more than just a "textbox" which is why its read
only.
You have to save that file and then use a label at that point, otherwise
your just wasting bandwidth.
2) You don't know the name of the file on the users end do you? Of
course you don't, just the file name, not the dirs or anything.
"Dave Adler" <dc*****@adlercomputing.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... Is there any way to retain the value of an HtmlInputFile control through
a postback?
I do some server side validation on the page when it is submitted and if
an error occurs on the page the HtmlInputFile control value is blank after
the postback. The EnableViewState for the control is set to true. I can't
put the postedFile.filename value in a hidden control and then put it back
into the HtmlInputFile control on postback because the postedFile.filename
and the value properties are read-only.
Any ideas?
Thanks in advance
David