1

This question seems to say that I can’t.

I am using AngularJs, but this is probably not AngularJs specific.

For screen real estate reasons, I display an "Upload file" button. When clicked, the contents of the screen are replaced by a hidden <div> (using ng-show and ng-hide) which contains a file selector, an “Upload” button and a “Cancel” button.

When the user selects a file, its name is shown by the file selector directive. When the user selects either “Upload” or “Cancel” button, that <div> is hidden.

When it reappears, I don’t want it to show the name of the previously selected file.

I realize that I could achieve this by removing the file selector from the DOM and inserting a new one, but was hoping to be able to just set a property.

Again, I only want to clear the selected file name, no set it to another file name.


http://www.w3schools.com/jsref/prop_fileupload_name.asp says "The name property sets or returns the value of the name attribute of a file upload button". I am at work & will try that when I get home this evening.

Any comments?

Community
  • 1
  • 1
Mawg says reinstate Monica
  • 38,334
  • 103
  • 306
  • 551

0 Answers0