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 (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);
}
}
{
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 ?
alaaPosted Sep 3, 2014, 2:47 PM
Guest UserPosted Sep 3, 2014, 4:34 AM
file1_upload1.jpg
file1_upload2.jpg
now when you're counting you can separate based on _upload1 & _upload2
#2: while uploading you can upload in two different folders. so you know which is upload 1 and which is upload2
Please click checkbox "This is correct answer" if you find it helpful!