.. include:: /Includes.rst.txt
properties.allowedMimeTypes
---------------------------

:aspect:`Option path`
      prototypes.<prototypeIdentifier>.formElementsDefinition.FileUpload.properties.allowedMimeTypes

:aspect:`Data type`
      array

:aspect:`Needed by`
      Frontend/ Backend (form editor)

:aspect:`Overwritable within form definition`
      Yes

:aspect:`form editor can write this property into the form definition (for prototype 'standard')`
      Yes

:aspect:`Mandatory`
      Yes

:aspect:`Default value (for prototype 'standard')`
      .. code-block:: yaml
         :linenos:
         :emphasize-lines: 7-

         FileUpload:
           properties:
             containerClassAttribute: input
             elementClassAttribute: ''
             elementErrorClassAttribute: error
             saveToFileMount: '1:/user_upload/'
             allowedMimeTypes:
               - application/msword
               - application/vnd.openxmlformats-officedocument.wordprocessingml.document
               - application/vnd.oasis.opendocument.text
               - application/pdf

.. :aspect:`Good to know`
      ToDo

:aspect:`Description`
      The allowed mime types for the file uploads, used as an allow list.

      This property is mandatory. If the list is **empty**, file uploads for this
      element are refused completely (security by default) - configure at least
      one allowed mime type. This behavior can be disabled by enabling the
      feature toggle :php:`security.form.allowUnrestrictedFileUploadMimeTypes`,
      which however is not recommended.

      In the form editor, only the mime types listed in the
      :ref:`selectOptions <prototypes.prototypeIdentifier.formelementsdefinition.fileupload.formeditor.editors.300>`
      of the editor can be selected. If a required mime type is missing, add it
      to the select options in a
      :ref:`custom form configuration <concepts-configuration-yamlregistration>`
      instead of leaving the list empty:

      ..  code-block:: yaml

          prototypes:
            standard:
              formElementsDefinition:
                FileUpload:
                  formEditor:
                    editors:
                      300:
                        selectOptions:
                          100:
                            value: text/plain
                            label: 'Text file (.txt)'
                          110:
                            value: application/zip
                            label: 'ZIP archive (.zip)'

      Only add mime types that are safe to be uploaded by website visitors.
      Avoid browser-active content such as :yaml:`text/html` or
      :yaml:`image/svg+xml`.
