I'm having a problem with the HTML tag <input type="file" />
in Google Chrome.
The 'Browse' button appears on the page as expected, but when I click it in order to select a file, the pop-up dialog window from the browser doesn't open at all.
I 've tested my form and in Firefox and works correct. Any ideas what's wrong and how can I fix it ?
Here is also the code:
<form action="" method="post" accept-charset="utf-8" enctype="multipart/form-data">
<label for="imgfile">File input</label>
<input type="file" name="imgfile" />
This happened to me on Chrome v88.0, and I tried everything -- removing all the event handlers, making the simplest form possible, removing all other html and js from the page -- and still the file-selection dialog would not appear when clicking the "Choose File" button.
Then I shut down Chrome and re-opened it ... and it worked again.
Golden advice:
Have you tried turning it off and on again?
In my case the problem was as follows :
Inside click hander, the code was canceling all propagation with
return false;
Removing this return statement solved problem with input=file.
There's no reason that this shouldn't work in Chrome. Have you tried copying JUST the mark up in the example you've given us into a HTML file, and opening that? Does it work? It should, unless there's some third party plugin or extension stopping it.
It may be that you have have mark up elsewhere causing this issue; perhaps a layer over the input field catching the click event before it can make it's way down to the "browse" button?
I knew the problem wasn't an issue with the specific web page I was currently browsing because I went to codepen and tried various file uploaders to no avail.
In my specific scenario, I had run a chrome update a few days ago but failed to relaunch chrome after the update.
Navigating to Help > About Google Chrome, Google had informed me that a relaunch was necessary.
After relaunch, the browser native file picker started appearing again.
I had the same issue, it would work in safari but not chrome. Turns out I just needed to update my chrome browser. Apparently if your chrome version is out of date by two weeks functionality that has been around for over a decade breaks...you know google engineering at its finest...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With