diff --git a/src/openforms/formio/api/validators.py b/src/openforms/formio/api/validators.py index 34dcd5aa13..a6a260ae03 100644 --- a/src/openforms/formio/api/validators.py +++ b/src/openforms/formio/api/validators.py @@ -111,6 +111,11 @@ def __call__(self, value: UploadedFile) -> None: "image/heif", ): return + # 4795 + # The sdk cannot determine the file type of .msg files, which result into + # content_type "". So we have to validate these for ourselves + elif mime_type == "application/vnd.ms-outlook" and ext == "msg": + return # gh #4658 # Windows use application/x-zip-compressed as a mimetype for .zip files, which diff --git a/src/openforms/formio/components/vanilla.py b/src/openforms/formio/components/vanilla.py index 109cb0560d..d5e6a7937a 100644 --- a/src/openforms/formio/components/vanilla.py +++ b/src/openforms/formio/components/vanilla.py @@ -338,14 +338,7 @@ class FileSerializer(serializers.Serializer): originalName = serializers.CharField(trim_whitespace=False) size = serializers.IntegerField(min_value=0) storage = serializers.ChoiceField(choices=["url"]) - type = serializers.CharField( - error_messages={ - "blank": _( - "Could not determine the file type. Please make sure the file name " - "has an extension." - ), - } - ) + type = serializers.CharField(required=False, allow_blank=True) url = serializers.URLField() data = FileDataSerializer() # type: ignore