Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291095

Add support for "accepts" attribute for file upload FAPI elements

$
0
0

Problem/Motivation

"accepts" attribute allows us to specify file types that can be uploaded via element. This enables some extra client-side validation of uploads and improves UX. Attribute is supported in all major browsers except Safari and IE. Browsers that do not support it will simply allow uploads of all files, which will be handles server-side anyway.

Proposed resolution

Add "#allowed_file_types" option to file and managed_file FAPI elements that will accept allowed file extensions. This will be translated to list of allowed mime types in process callback.

Remaining tasks

Everything ;)

User interface changes

None.

API changes

None. Just adds new functionality.

Original report by @tsphethean

This was originally posted by tsphethean in #625958-106: Support Uploading Multiple Files for HTML5 Browsers via #multiple attribute.


Viewing all articles
Browse latest Browse all 291095

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>