Skip to content

Is there a way to add a file type in "Restrict file types" list for the "Attachement Field"? #281

Discussion options

You must be logged in to vote

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

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@niklasnatter
Comment options

Answer selected by sanderquirynen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants