Closed
Bug 1145379
Opened 11 years ago
Closed 11 years ago
HTML input type="file" accept attribute not parsing extensions
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 826176
People
(Reporter: wgerard, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36
Steps to reproduce:
I created a file input like so:
<input type="file" accept=".jpg" />
Actual results:
I was able to choose files of any type, not just files with a ".jpg" extension
Expected results:
I should have only been able to choose files with ".jpg" extensions.
Reporter | ||
Comment 1•11 years ago
|
||
Hi, apologies if this has been brought up before - I couldn't find anything in similar issues.
MDN indicates I should be able to create a file input with extensions in a ".extension,.extension" format: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept
But a quick fiddle shows that not to be true, at least for a number of machines/people I tested with:
http://jsfiddle.net/861rr1a7/2/
MIME types seem to work fine, but file extensions don't seem to be respected. Interestingly that also seems to be the case in Safari 7.1.3, but not Chrome 41.
We were testing on 36.0.1
Comment 2•11 years ago
|
||
You can see under https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Browser_compatibility that Gecko doesn't support "accept=[file extension]" at the moment....
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Updated•10 years ago
|
Component: Untriaged → DOM: Core & HTML
OS: Mac OS X → All
Product: Firefox → Core
Hardware: x86 → All
You need to log in
before you can comment on or make changes to this bug.
Description
•