Fileupload doesn't upload custom filetype if it has a required property

Found in

EPiServer.Forms 4.18.0

Fixed in

EPiServer.Forms 4.22.0

Created

Dec 05 2018

Updated

Jan 02 2019

State

Closed, Fixed and tested


Description

Steps to reproduce

1. Create a custom media content type, and add a property with a required constraint:

[ContentType(GUID = "5FFBAFBF-8122-42B2-8A1C-56C88773BEC7")]
[MediaDescriptor(ExtensionString = @"pdf")]
public class PdfFile : MediaData
{
[Required]
public virtual string IAmRequired {get;set;}
}

2. Create a new form with a fileupload field.
3. Use the form and upload a PDF file.
4. View submissions.

Expected:
A submission with the file is available.

Actual:
A submission with the file missing.