How to restrict the type of files users can upload


#1

Hi,
It there a way to restrict the type of files users can upload in registration forms?
Thanks for your replies,
DdM


#2

Hey,

as far as I know there is no way to do that using Indico functionalities. If you manage your own instance of Indico I think you could extend the FileField class (https://github.com/indico/indico/blob/master/indico/modules/events/registration/fields/simple.py#L247) with the validators property. There you could probably check the mimetype of the file and fail in case it is not allowed.


#3

Hi, thank you for your reply and for your guidance. I’ll try to do what you suggest.
Best regards,
DdM