Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firefox sometimes ignores JPEG files with .jpg and .jpeg extensions on file input

When there's a file input control to upload pictures that accepts JPEG files:

<input type="file" accept="image/png, image/jpeg">

… my copy of Firefox will only allow JPEG files with ".jfif" extension:

Select file dialog

It only happens in my PC (other coworkers get "*.jpg; *.jpeg"), it only happens in Firefox (Chrome and Edge implement their own extension list) and it didn't happen a while ago.

What does this behaviour depend on? Is this a common issue that I should address in my upload markup?

like image 319
Álvaro González Avatar asked Oct 05 '18 06:10

Álvaro González


1 Answers

Even in 62.0.3 the bug is still reproducable for me - But the bug is known and already listed at bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1367490

This workaround works for me:

<input type="file" accept=".jfif, .jpeg, .jpg">
like image 99
Jns Avatar answered Nov 15 '22 23:11

Jns