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 14bd91a5..5df43142 100644 --- a/plone/app/z3cform/templates/file_input.pt +++ b/plone/app/z3cform/templates/file_input.pt @@ -90,6 +90,7 @@ =1.3.6", "plone.base", "plone.app.contentlisting", + "plone.formwidget.namedfile>3.0.3", "plone.i18n", "plone.protect", "plone.registry",