diff --git a/news/198.feature b/news/198.feature new file mode 100644 index 00000000..1d722dc4 --- /dev/null +++ b/news/198.feature @@ -0,0 +1,14 @@ +Add support for the "accept" attribute on file inputs. + +If the widget's field - if there is one - has the "accept" attribute set (the +`NamedImage` field has `image/*` set by default) then this is rendered as an +`accept` attribute on the file input. + +This would restrict the allowed file types before uploading while still being +checked on the server side. + +Fixes: https://github.com/plone/plone.formwidget.namedfile/issues/66 +Depends on: +- https://github.com/plone/plone.namedfile/pull/158 +- https://github.com/plone/plone.formwidget.namedfile/pull/67 +[thet] diff --git a/plone/app/z3cform/templates/file_input.pt b/plone/app/z3cform/templates/file_input.pt index 58c57443..5a2a1f78 100644 --- a/plone/app/z3cform/templates/file_input.pt +++ b/plone/app/z3cform/templates/file_input.pt @@ -133,6 +133,7 @@