Try our conversational search powered by Generative AI!

Unable to upload video files



I'm having trouble uploading video files.

Has the following code:

    [ContentType(GUID = "1f7218e9-bddf-4734-b067-4d2d68b5dade")]
    [MediaDescriptor(ExtensionString = "mp4,webm,ogg,mov")]
    public class VideoMediaData : VideoData
            Name = "Name",
            Description = "Name of the video file",
            Order = 10)]
        public virtual string VideoName { get; set; }

Have no problems uploading images and for example PDF files with similar solution.

Error messages I get when uploading video files are:
Object reference not set to an instance of an object.

Any thoughts on why it doesn't work and maybe some suggestion on some solution I can try?

May 19, 2020 8:51

It might have something to do with the size of the video, by default only 4MB files can be accepted by ASP.NET. Can you get the full error message/stacktrace ?

May 19, 2020 12:28

I use two video files for testing, one .mp4 file that has 375 kb in size, the other file is a .webm of 2.07 mb.
Same error for both files.

Can upload images larger than 4 mb without problems.

If I check the network tab in Chrome Developer Tools, I get this JSON response:

[{"index":0,"fileName":"small.mp4","errorMessage":"Object reference not set to an instance of an object.","contentLink":null}]

Nothing is logged in the log file.

No stack trace, 

Error message appears in the file upload box, so it will not be a total crash of site.

Cannot share link to an image for any reason.

Edited, May 19, 2020 12:38

I used same code in the Alloy demo site it works fine for me and able to upload more than 4MB size file. You can try with below settings.

        <requestLimits maxAllowedContentLength="1073741824" />

  <location path="EPiServer">
      <httpRuntime maxRequestLength="1048576" requestValidationMode="2.0" executionTimeout="7200" />
May 19, 2020 18:46

Hi Ompa

Are you able to see your VideoMediaData inside "Media Type" in CMS->Admin->Content Type?

Can you try renaming this "VideoMediaData" class with some other name and give a try?

Edited, May 20, 2020 6:37


Have added these lines to Web.config, but it remains the same problem.

I have created an empty CMS site and there is also a Commerce installed. Installed according to the documentation.
So is it something I miss, something that Alloy comes with but that doesn't come with an empty CMS installation?
I see VideoMediaData under MediaTypes. The other media types are also there.

May 20, 2020 7:01
Ravindra S. Rathore - May 20, 2020 7:07
Can you try renaming this "VideoMediaData" class with some other name and give a try?


Deleted the class completely, created it again with a new name, and now it works.

Thank you all for your help!

May 20, 2020 7:34
Ravindra S. Rathore - May 20, 2020 7:40
Great !!! I also updated my above comment answer in a thread
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.