Dear Programmer I want to upload photo ans sign.
I write code for read image extension both images (photo ans sign), when i am upload both images than this code work fine, but whne i am upload one image and another file than this code is not working properly, my code is below as -
string file_ext = Path.GetExtension(FileUpload_Photo.PostedFile.FileName);
string file_ext1 = Path.GetExtension(FileUpload_Sign.PostedFile.FileName);
if (file_ext.ToLower() == ".jpg" || file_ext.ToLower() == ".bmp" || file_ext.ToLower() == ".png" ||
file_ext1.ToLower() == ".jpg" || file_ext1.ToLower() == ".bmp" || file_ext1.ToLower() == ".png")
{
//Save Image Name
FileUpload_Photo.SaveAs(Server.MapPath(virtualFolder) + "\\" + lbl_UniqueId.Text + "" + file_ext);
FileUpload_Sign.SaveAs(Server.MapPath(virtualFolder1) + "\\" + lbl_UniqueId.Text + "S" + file_ext1);
//Set Image Name
string photo = lbl_UniqueId.Text + "" + file_ext;
string sign = lbl_UniqueId.Text + "S" + file_ext1;
//Target Folder
string physicalFolder = Server.MapPath(virtualFolder);
string physicalFolder1 = Server.MapPath(virtualFolder1);
//Retrive Images
emp_img.Visible = true;
emp_sign.Visible = true;
emp_img.ImageUrl = Server.MapPath(virtualFolder) + @"\" + lbl_UniqueId.Text + "" + file_ext;
emp_sign.ImageUrl = Server.MapPath(virtualFolder1) + @"\" + lbl_UniqueId.Text + "" + file_ext1;
//connectionsting