]> cat aescling's git repositories - mastodon.git/commit
Use file extensions in addition to MIME types for file picker (#5029)
authorunarist <m.unarist@gmail.com>
Wed, 20 Sep 2017 17:07:23 +0000 (02:07 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Wed, 20 Sep 2017 17:07:23 +0000 (19:07 +0200)
commitc8580eb806512fcc8ca76303e7d837f77c2cb413
tree8b757fa3b95592e5096802fba1c2761f63b0dac0
parentf41e70ca382d9ac158368eddc40783357b81b42c
Use file extensions in addition to MIME types for file picker (#5029)

Currently we're using a list of MIME types for `accept` attribute on `input[type="file"]` for filter options of file picker, and actual file extensions will be infered by browsers. However, infered extensions may not include our expected items. For example, "image/jpeg" seems to be infered to
only ".jfif" extension in Firefox.

To ensure common file extensions are in the list, this PR adds file extensions in addition to MIME types. Also having items in both format is encouraged by HTML5 spec.

https://www.w3.org/TR/html5/forms.html#file-upload-state-(type=file)
app/models/media_attachment.rb
app/serializers/initial_state_serializer.rb