I am using asp.net 3.5 version. In a single page I have 5 asp:FileUpload controls.
I have tried using the following code:
string path = Server.MapPath("~/MyFiles/");
string filename = "";
string extension = "";
int fcount = 1;
HttpFileCollection HFC = Request.Files;
for (int c = 0; c < HFC.Count; c++)
{
HttpPostedFile HPF = HFC[c];
if (HPF.ContentLength < 2100000) //2,100,000 bytes (approximately 2 MB)
{
extension = System.IO.Path.GetExtension(HPF.FileName);
filename = "ML" + MyId + fcount + extension;
HPF.SaveAs(path + "\\" + filename);
}
fcount++;
DBimg = filename + ",";
}
As it has 5 different upload control I am not getting the values for a single control. I need to save files that has been selected separately from those upload controls into separate folders. From HPF how can I get different controls.Is there any way out??
P.N. - In asp.net 3.5 file upload controls for multiple selection doesn't provide MyUploader1.PostedFiles instead it provide MyUploader1.PostedFile
Please help me out...Any advice is welcome.