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.

1.
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.

2.
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.

3.
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

@{Html.BeginForm();}
   @Html.Raw(ViewBag.uploaderhtml)
@{Html.EndForm();}

Trusted by

15,000 Customers

AJAX Uploader has more than 15,000 customers, and has been sold in over 60 countries.

23 languages are supported, and more are being added.