Skip to content

Additional Feature Implementing Large File Upload Editor

Victor Tomaili edited this page May 3, 2021 · 1 revision

Implementing Large File Upload Editor

  1. Support gigabyte size file upload (Chunk upload) Tested with 8.36GB file.

  2. Use the similar setting as MultipleFileUploadEditor

How-to

  1. Add Microsoft.AspNet.WebApi using Nuget Package Manager

  2. Add WebApiConfig.cs in App_Start folder

WebApiConfig.cs

using System.Web.Http;

namespace YourProjectName
{
    public class WebApiConfig
    {
        public static void Register(HttpConfiguration configuration)
        {
            configuration.Routes.MapHttpRoute("API Default", "api/{controller}/{id}",
                new { id = RouteParameter.Optional });
        }
    }
}
  1. Add WebApiConfig.Register(GlobalConfiguration.Configuration); in Global.asax.cs just below FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);

  2. Download all files in Modules/Common/LargeFileUpload (link below) and place in your project (Don't forget to change the namespace)

https://github.com/wezmag/serenity-large-file-upload-sample/tree/master/SereneLargeFileUpload/SereneLargeFileUpload.Web/Modules/Common/LargeFileUpload

  1. Build the project, run T4 template and done. Your project is ready for upload gigabyte size files.

Usage

Please refer to Northwind Region Sample:

https://github.com/wezmag/serenity-large-file-upload-sample/blob/master/SereneLargeFileUpload/SereneLargeFileUpload.Web/Modules/Northwind/Region/RegionRow.cs#L38

https://github.com/wezmag/serenity-large-file-upload-sample/blob/master/SereneLargeFileUpload/SereneLargeFileUpload.Web/Modules/Northwind/Region/RegionForm.cs#L14

If you run into any issues or find any bugs, please open an issue in my repo.

Clone this wiki locally