string onlyname = string.Empty;
int isExist;
if (imgupload.HasFile)
{
string categoryname = txtCategoryName.Text;
string imagename = categoryname.Replace(" ", "");
imagename= imagename + "_Left";
string filePath = imgupload.FileName;
string filename = filePath.Substring(filePath.LastIndexOf("\\") + 1);
string[] filetype = filename.Split('.');
onlyname = imagename + "." + filetype[1];
imgupload.SaveAs(Server.MapPath("~/images/inner/") + onlyname);
lblmsg.Text = "Upload status: File uploaded!";
}
No comments:
Post a Comment