hi everyone, i have fileuploader when i upload a file in fileuploader its working correct, when leave empty/ dont load any file i m getting error " Could not find a part of the path 'D:\Improv_management_system\Administration\Upload\'.". Below is my code for file upload.
i
str = string.Format(" insert into IMSemployee_details(Employee_Image,Employee_ID,Employee_Name) values(@Employee_Image,@Employee_ID,@Employee_Name)"); cmd = new SqlCommand(str, con); if (FileUpload1.PostedFile != null) { string Filenmame = Path.GetFileName(FileUpload1.PostedFile.FileName); FileUpload1.SaveAs(Server.MapPath("~/Administration/Upload/" + Filenmame)); cmd.Parameters.AddWithValue("@Employee_Image", "~/Administration/Upload/" + Filenmame);
} cmd.Parameters.AddWithValue("@Employee_ID", txtEmpID.Text); cmd.Parameters.AddWithValue("@Employee_Name&quo ...

Go to the complete details ...