sulu / SuluFormBundle

Form Bundle for handling Dynamic and Symfony Forms in https://sulu.io
MIT License
81 stars 78 forks source link

Add document restriction for attachment #349

Open Olivier127 opened 1 year ago

Olivier127 commented 1 year ago
Q A
Bug? no
New Feature? yes
Bundle Version Specific version or SHA of a commit
Sulu Version Specific version or SHA of a commit
Browser Version Browser name and version

Actual Behavior

When you want to restrict the type of attachment field, you can only restrict it to image, sound and video.

Expected Behavior

Restrict to PDF document for example.

matthiasseghers commented 1 year ago

Also interested in having this feature.

creatiombe commented 1 year ago

I made a job application attachment field, you can just make a extra field type and there you can define the extra mime types

But i agree, simple things like zip, pdf and word should be allowed

alexander-schranz commented 1 year ago

But i agree, simple things like zip, pdf and word should be allowed

They are allowed if you don't restrict them. If you select none for the restriction file types they are allowed to upload zip, pdf, ... or whatever they want.

Restricting is currently done based on the mime types filters va audio/*, video/*, image/*, ... same as Sulu media types work. There is no specific group yet for zip or pdf as they are just a general application/... mime types.

Still Symfony from system is easy to extend via a Form Extension it is even possible to add all kind of constraints you want to a project.