Step 2: Download uploaded .Zip file from this article. Extract it and copy Scripts folder from extracted folder and paste it in your project.
Step 3 : Add these highlighted lines in the <head> section of your Default.aspx page as shown below:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Uplaoding Multiple Files</title>
<script type="text/javascript" src="Scripts/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="Scripts/swfobject.js"></script>
<script type="text/javascript" src="Scripts/jquery.uploadify.v2.1.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#UploadFiles').uploadify({
'uploader': 'Scripts/uploadify.swf',
'script': 'UploadFiles.aspx',
'cancelImg': 'Scripts/cancel.png',
'auto': 'true',
'multi': 'true',
'buttonText': 'Select Files',
'queueSizeLimit': 500,
'simUploadLimit': 2
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
</form>
</body>
</html>
Step 4: Add a line as shown below to the body section in the Default.aspx page.
<body>
<form id="form1" runat="server">
<div id="UploadFiles"></div>
</form>
</body>
Step 5: Create another .aspx page and name it "UploadFiles.aspx". Replace code of your UploadFiles.aspx.cs file with the code given below:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
public partial class UploadFiles : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
HttpPostedFile uploads = Request.Files["FileData"];
string file = System.IO.Path.GetFileName(uploads.FileName);
string Apath = Server.MapPath("~/") + "UploadedFiles";
if (!Directory.Exists(Apath))
Directory.CreateDirectory(Apath);
string AppPath = Server.MapPath("~/");
uploads.SaveAs(Apath + "\\" + file);
}
}
Step 6 : Add this line in web.config file of your project under <system.web> section.
<system.web>
<httpRuntime maxRequestLength="102400"></httpRuntime>
</system.web>
Press F5 and start uploading ……..

Dennis KumarPosted Jul 9, 2018, 9:41 AM
This is Not Working for me....
Prabhu PPosted Sep 17, 2012, 2:00 AM
Hi Mukesh , It is very nice I am using this but I am not getting how to check if file already exists in the server then it should show alert message to the user saying that do you want overwrite file?. Please let me know how to do this using java script or C#. Thanks.
Phuong NguyenPosted Jul 28, 2012, 12:11 AM
Very nice article Mukesh Kumar. It works very smooth. Is there a way to catch the upload completed event? I like to display the images after the upload is completed. Thanks.
bikash lamaPosted Apr 5, 2012, 2:05 AM
How can I put the script on same page...because i have to access other controls too which are on the same page.