We want to reduce the number of steps it takes for a user to upload a file on our website; so we're using jQuery to open and postback files using the below markup (simplified):
Change profile picture
<!-- Hidden to keep the UI clean -->
For security reasons, what you are trying to do is not possible. It seems to be the IE9 will not let you submit a form in this way unless it was an actual mouse click on the File Upload control that triggers it.
For arguments sake, I was able to use your code to do the submit in the
change handler, but it worked only when I clicked the
Browse button myself. I even set up polling in the
$(document).ready method for a variable set by the
change handler that indicates a submission should be triggered - this didn't work either.
The solutions to this problem appear to be:
Styling a File Upload: