Thursday, May 26, 2022
HomeError SolveHow to upload large size video | ASP.NET Core - EJ 2...

How to upload large size video | ASP.NET Core – EJ 2 Forums

How to upload large-size videos using the Syncfusion File upload controller?

The below example is specifically for MVC DOT NET CORE. (Video size 3GB)

You need to take 4 steps while you are interested to perform the task.

1) First Create web.config file in your MVC .NET Core Project.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.webServer>
        <security>
            <requestFiltering>
                <requestLimits maxAllowedContentLength="3000000000" />
            </requestFiltering>
        </security>
    </system.webServer>
</configuration>

2) Open your startup.cs file and in the ConfigurationService method, specified the below code.

public void ConfigureServices(IServiceCollection services)
{
 services.Configure<FormOptions>(o => {
                o.ValueLengthLimit = int.MaxValue;
                o.MultipartBodyLengthLimit = 3000000000;
                o.MemoryBufferThreshold = int.MaxValue;
            });
}

3) Open your .cshtml page and write the below script code.

@{
    var asyncSettings = new Syncfusion.EJ2.Inputs.UploaderAsyncSettings { SaveUrl = @Url.Content("~/UploadFiles/Save/"), RemoveUrl = @Url.Content("~/UploadFiles/Remove"), ChunkSize = 3000000000 };

4) In the same .cshtml page, write your syncfusion file uploader coding.

  <ejs-uploader id="formFileVideo" selected="onSelect"
                              allowedExtensions=".mp4"
                              asyncSettings="@asyncSettings " directoryUpload="true" maxFileSize="3000000000" success="onSuccess"></ejs-uploader>

Most Important Note:

In all the places you have to place the same number “3000000000” or your choice number. Otherwise, you will get an error in it.

To perform the same task took me 3 days, so I hope the above code would help you.

If you like the blog post please do share it and give your comment.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

Recent Comments