Using Uploader in ASP.Net MVC

The following guide shows the steps to implement the Uploader Control into .NET MVC(Razor). If you haven't downloaded the software, please download it from here.


Install the assembly

a. Copy the assembly and license file (CuteWebUI.AjaxUploader.dll, AjaxUploader.lic) to your application bin folder.

b. Copy UploadHandler.ashx to your MVC site.


Add Uploader httpModule to web.config's httpModules list

To allow Ajax Uploader to handle upload requests, you need to add its HttpModule to your application.


Using the Uploader in a MVC page

a. Register Uploader control in MVC Controller

using (CuteWebUI.MvcUploader uploader = new CuteWebUI.MvcUploader(System.Web.HttpContext.Current))
    uploader.UploadUrl = Response.ApplyAppPathModifier("~/UploadHandler.ashx");
    uploader.Name = "myuploader";
    uploader.AllowedFileExtensions = "*.jpg,*.gif,*.png,*.bmp,*.zip,*.rar";
    uploader.InsertText = "Select a file to upload";
    ViewData["uploaderhtml"] = uploader.Render();

b. Insert an Uploader instance into the MVC page