I forgot how filesystems work...

This commit is contained in:
Michael 2017-03-25 12:50:31 -04:00
parent 73e2639010
commit a3f14c06c1

View file

@ -53,6 +53,12 @@ public ActionResult PostSkin(CreateSkinViewModel model)
skin.VersionId = "";
string repoFolder = $"~/Uploads/{ACL.UserNameRaw(skin.UserId)}/SkinFiles";
string screenshotFolder = $"~/Uploads/{ACL.UserNameRaw(skin.UserId)}/Screenshots";
if (!Directory.Exists(Server.MapPath(repoFolder)))
Directory.CreateDirectory(Server.MapPath(repoFolder));
if (!Directory.Exists(Server.MapPath(screenshotFolder)))
Directory.CreateDirectory(Server.MapPath(screenshotFolder));
skin.DownloadUrl = Path.Combine(repoFolder, model.SkinFile.FileName);
model.SkinFile.SaveAs(Path.Combine(Server.MapPath(repoFolder), model.SkinFile.FileName));