Hi kavithav,
if you are using VS 2012 or 2013 you can refer below article.
if not then refer below.
You can store the filenames or whatever data regarding the file based on fileuploader using below code.
In sample code i am only saving the file names to the array based on the fileupload control ids.
I have created a sample which full fill you requirement you need to modify the code according to your need.
HTML
<div>
<asp:FileUpload ID="filupload1" runat="server" Width="224px" multiple="multiple" /><br />
<asp:FileUpload ID="filupload2" runat="server" Width="224px" multiple="multiple" /><br />
<asp:FileUpload ID="filupload3" runat="server" Width="224px" multiple="multiple" /><br />
<asp:FileUpload ID="filupload4" runat="server" Width="224px" multiple="multiple" /><br />
<asp:Button ID="btnadd" runat="server" OnClick="btnadd_Click" Text="AddItem" Width="80px" />
</div>
C#
protected void btnadd_Click(object sender, EventArgs e)
{
List<string> fileupload1 = new List<string>();
List<string> fileupload2 = new List<string>();
List<string> fileupload3 = new List<string>();
List<string> fileupload4 = new List<string>();
for (int i = 0; i < Request.Files.Count; i++)
{
if (Request.Files.Keys[i].ToLower() == "filupload1")
{
fileupload1.Add(Request.Files[i].FileName);
}
if (Request.Files.Keys[i].ToLower() == "filupload2")
{
fileupload2.Add(Request.Files[i].FileName);
}
if (Request.Files.Keys[i].ToLower() == "filupload3")
{
fileupload3.Add(Request.Files[i].FileName);
}
if (Request.Files.Keys[i].ToLower() == "filupload4")
{
fileupload4.Add(Request.Files[i].FileName);
}
}
}
VB.Net
Protected Sub btnadd_Click(sender As Object, e As EventArgs)
Dim fileupload1 As New List(Of String)()
Dim fileupload2 As New List(Of String)()
Dim fileupload3 As New List(Of String)()
Dim fileupload4 As New List(Of String)()
For i As Integer = 0 To Request.Files.Count - 1
If Request.Files.Keys(i).ToLower() = "filupload1" Then
fileupload1.Add(Request.Files(i).FileName)
End If
If Request.Files.Keys(i).ToLower() = "filupload2" Then
fileupload2.Add(Request.Files(i).FileName)
End If
If Request.Files.Keys(i).ToLower() = "filupload3" Then
fileupload3.Add(Request.Files(i).FileName)
End If
If Request.Files.Keys(i).ToLower() = "filupload4" Then
fileupload4.Add(Request.Files(i).FileName)
End If
Next
End Sub