asp net multiple file upload with progress bar HD

03.07.2015
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/07/aspnet-multiple-file-upload-with.html In this video we will discuss, using jQuery progressbar with asp.net file upload control. While the files are being uploaded we want to display the jQuery progress bar. As soon as the upload is complete, we want to display complete message in the progress bar, and it should slowly fade out. UploadHandler.ashx Code using System.IO; using System.Web; namespace Demo { public class UploadHandler : IHttpHandler { public void ProcessRequest(HttpContext context) { if (context.Request.Files.Count > 0) { HttpFileCollection selectedFiles = context.Request.Files; for (int i = 0; i < selectedFiles.Count; i++) { System.Threading.Thread.Sleep(1000); HttpPostedFile PostedFile = selectedFiles[i]; string FileName = context.Server.MapPath("~/Uploads/" + Path.GetFileName(PostedFile.FileName)); PostedFile.SaveAs(FileName); } } } public bool IsReusable { get { return false; } } } } WebForm code <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Demo.WebForm1" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="jquery-1.11.2.js"></script> <script src="jquery-ui.js"></script> <link href="jquery-ui.css" rel="stylesheet" /> <script type="text/javascript"> $

Похожие видео

Показать еще