public static string GetImageUrlPath(PreDefImageLocation loc) { switch (loc) { case PreDefImageLocation.GameImage: return(@"Content/images/Uploads/GameImage/"); case PreDefImageLocation.QuestionImage: return(@"Content/images/Uploads/QuestionImage/"); default: break; } return(""); }
public static string GetDefaultImageLocation(PreDefImageLocation preDefImageLocation) { switch (preDefImageLocation) { case PreDefImageLocation.GameImage: return("\\GameImage\\"); case PreDefImageLocation.QuestionImage: return("\\QuestionImage\\"); default: break; } return(""); }
public static UploadHandler UploadImage(HttpPostedFileBase imageFile, Point size, PreDefImageLocation location) { if (FileIsImage(imageFile)) { UploadHandler uploadFile = new UploadHandler(imageFile, FileType.Image); uploadFile.Size = size; uploadFile.ImageFolder = GetDefaultImageLocation(location); return(Upload(uploadFile)); } return(null); }