Hidden file input does not retain value on submit
I have a hidden file input with a fake button and input for browser display consistency. I currently have the original input visible as well, and have discovered that using it to upload the file everything runs fine.
HTML (this is in a partial view so I can add more inputs and return a file collection, I just pulled it out to the main view and hard coded the 0 in for this and another bug).
This is a security restriction built into Internet Explorer (I’ve tested v6.0 to v10), yes it allows you to programatically click the browse button but it will clear the box when you submit the form – basically to stop users from being tricked into uploading files.
So your options are to take a different approach to styling, this example basically makes the original button opaque on top of your nicely styled button (credit to Andrew here):