@manhnguyenv

Welcome to my blog!

Debug

October 6, 2017 16:51

Save JSON when HTTP POST

var uploadsProjectsFolder = Path.Combine(_hostingEnvironment.WebRootPath, @"Uploads\Projects\");

if (!Directory.Exists(uploadsProjectsFolder)) Directory.CreateDirectory(uploadsProjectsFolder);

System.IO.File.WriteAllText($"{Path.Combine(uploadsProjectsFolder, projectId.ToSafeString())}.txt", Newtonsoft.Json.JsonConvert.SerializeObject(model));

Categories

Recent posts