Is there a way to add a file type in "Restrict file types" list for the "Attachement Field"? #281
-
Is there a way to add a file type in "Restrict file types" list for the "Attachement Field"? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Answer from @alexander-schranz on Slack channel: The restriction is currently based on exist types of sulu media (video, audio, image, documents). Solution 1 Solution 2: |
Beta Was this translation helpful? Give feedback.
Answer from @alexander-schranz on Slack channel:
The restriction is currently based on exist types of sulu media (video, audio, image, documents).
Solution 1
You could workaround your problem by validating the type in the frontend by adding in your custom form theme <input accept="my_mime_type" to the file upload input.
Solution 2:
You could also decorate the exist AttachmentType services: https://github.com/sulu/SuluFormBundle/blob/2.x/Dynamic/Types/AttachmentType.php