2
Answers

2 multifile upload

alaa

alaa

10y
871
1
hi every body 
how can i use 2 multifile upload in the same page
i had try this code
protected void uploadFile_Click(object sender, EventArgs e)
{
if (UploadImages1.HasFiles)
{
foreach (HttpPostedFile uploadedFile in UploadImages1.PostedFiles)
{
uploadedFile.SaveAs(System.IO.Path.Combine(Server.MapPath("~/Images/"),
uploadedFile.FileName)); listofuploadedfiles.Text += String.Format("{0}<br />", uploadedFile.FileName);
}
}
 
if (UploadImages2.HasFiles)
{
foreach (HttpPostedFile uploadedFile in UploadImages2.PostedFiles)
{
uploadedFile.SaveAs(System.IO.Path.Combine(Server.MapPath("~/Images2/"),
uploadedFile.FileName)); listofuploadedfiles.Text += String.Format("{0}<br />", uploadedFile.FileName);
}
}

}
 
but they count the all photos despite they are different the 2 file upload count the all photos on page
how can solve this problem ? 
 
 

Answers (2)