Hi,
What I'm trying to do is this: I have a FileUpload control for the user to select the file from their local machine to upload. I also have a separate "name" textbox for the user to enter a logical name for the file. What I want is, after the user browses for a file, to take the actual physical name of the file and populate the name textbox with that. Reason being, then they can optionally update the logical name without affecting the physical name, but clearly show that the physical filename is the default. (And also give the option to change the logical name of the file later without requiring an upload).
The problem is, the FileUpload control is really light on events. I don't see any event to listen for that corresponds with what I would call an "OnBrowseComplete" where I could then simply set txtName.Text = FileUpload1.FileName. No idea why the control designers didn't give us such a useful event but that's another question.
I am open to a javascript solution but again am not sure what event would be listened for on the client side and also I am not sure how to get the filename property out of the FileUpload control in Javascript, or if that is even possible.
Any clever solutions from the peanut gallery?
Cheers,
Anye