Hi,
Simplified.
The page has the following code:
<input type="file" name="file" id="file" />
A user selects a file using the input control (above).
The page is posted back to the server. Maybe to check a value in another field. Or for whatever other reason.
In the code behind, the code gets the value of the chosen/selected file, as follows:
foreach (string file in Request.Files)
{
HttpPostedFile hpf = Request.Files[file] as HttpPostedFile;
if (hpf.ContentLength == 0)
continue;
string cFileName = System.IO.Path.GetFileName(hpf.FileName);
}
And I would like the value cFileName to be set to the input control. Otherwise, the input control becomes empty, after post back.
I can't figure out how to set the value in the Input control type='file' to this file name. Anyone can help?
TIA
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham