public static void saveImage(int newID) { string fileName = newID.ToString(); if (imgUpload.HasNewImage) { imgUpload.SaveProcessedImageToFileSystem("~/uploadedImg/department/" + fileName + ".jpg"); } ListLoad(); }
public static void saveImage(int itemID, int newID) { string fileName = newID.ToString(); if (imgUpload.HasNewImage) { string subPath = "~/uploadedImg/itemPics/" + itemID; string refPath = HostingEnvironment.MapPath(subPath); bool IsExists = System.IO.Directory.Exists(refPath); if (!IsExists) { System.IO.Directory.CreateDirectory(refPath); } imgUpload.SaveProcessedImageToFileSystem("~/uploadedImg/itemPics/" + itemID + "/" + fileName + ".jpg"); } ListLoad(); }