public JsonResult UploadImagePraise(IFormFile file) { this.Upload(new TfUploadModel() { FilePath = TfSettings.GetSettings("PrayerForums", "ImageUploadTemp"), File = file }, false); return(this.Conclude()); }
public override void HandleModel() { this.Request.Entity.active = 1; this.Request.Update(); this.Request.ClearCase(); this.Request.SelectToEntity(); TfEmail.Send( TfSettings.GetSettings("PrayerForum", "ChurchEmail").ToString(), "request_activate_email", this.Request.Entity.ToDictionary()); }
private string ImageUrl(string imageUrl, int?id) { if (this.Praise.image_url.IsEmpty()) { return(string.Empty); } var tempPath = TfSettings.GetSettings("PrayerForums", "ImageUploadTemp"); var imagePath = TfSettings.GetSettings("PrayerForums", "ImageUploadPraise"); var fileName = Path.GetFileName(imageUrl); Directory.CreateDirectory(imagePath); var oldPath = Path.Combine(tempPath, fileName); var newPath = Path.Combine(imagePath, $"praise_{id}{Path.GetExtension(fileName)}"); File.Move(oldPath, newPath); return($"{TfSettings.Web.SiteUrl}/{newPath.Replace("\\", "/").Replace("wwwroot/", "")}"); }