Issue Description:
The form is successfully submitted with one or multiple files. But when viewing the submission, the form seems to have failed to save the files and the uploaded file was empty.
Reason:
In the form, you allow to upload with different file types such as (.png, .pdf, .jpg, .mp4), but in CMS you only allow uploading files with extension (.png, .pdf, .jpg) without allowing uploading of .mp4 files. So when using the form to upload .mp4 files, it will be failed to save that file to blob.
Solution:
You need to define the media types in your content model like below:
using EPiServer.Core;using EPiServer.DataAnnotations;
using EPiServer.Framework.DataAnnotations;
using System;
namespace EP170621.Models.Media
{
[ContentType(GUID = "EE3BD195-7CB0-4756-AB5F-E5E223CD9820")]
[MediaDescriptor(ExtensionString = "pdf,png,jpg,mp4")]
public class GenericMedia : MediaData
{
/// <summary>
/// Gets or sets the description.
/// </summary>
public virtual String Description { get; set; }
}
}
For the reference: https://docs.developers.optimizely.com/content-cloud/v12.0.0-content-cloud/docs/media-types-and-templates
Article is closed for comments.