public static Result Save(String oPicAbsPath, int userId) { Result result = new Result(); if (file.Exists(oPicAbsPath) == false) { String msg = "图片不存在" + oPicAbsPath; logger.Error(msg); result.Add(msg); return(result); } AvatarSaver aSaver = AvatarSaver.New(oPicAbsPath); return(savePicCommon(aSaver, userId, result, sys.Path.DiskAvatar)); }
private static Result upload_private(String uploadPath, HttpFile postedFile, int userId) { logger.Info("uploadPath:" + uploadPath + ", userId:" + userId); Result result = new Result(); Uploader.checkUploadPic(postedFile, result); if (result.HasErrors) { return(result); } AvatarSaver aSaver = AvatarSaver.New(postedFile); return(savePicCommon(aSaver, userId, result, uploadPath)); }