space is a wonderful place, time is a wonderful time

This commit is contained in:
Michael 2017-03-26 18:38:44 -04:00
parent 579355e512
commit f2ab2e93fb

View file

@ -121,7 +121,15 @@ public ActionResult BackupAssets()
string backupUrl = backupDir.Remove(0, 1) + "/ShiftOS-" + DateTime.Now.ToString().Replace("/", "-") + ".zip"; string backupUrl = backupDir.Remove(0, 1) + "/ShiftOS-" + DateTime.Now.ToString().Replace("/", "-") + ".zip";
string backupname = Path.Combine(backupServerDir, "ShiftOS-" + DateTime.Now.ToString().Replace("/", "-") + ".zip"); string backupname = Path.Combine(backupServerDir, "ShiftOS-" + DateTime.Now.ToString().Replace("/", "-") + ".zip");
try
{
System.IO.Compression.ZipFile.CreateFromDirectory(Server.MapPath("~/Uploads"), backupname); System.IO.Compression.ZipFile.CreateFromDirectory(Server.MapPath("~/Uploads"), backupname);
}
catch
{
return Content(backupname + "<br/><br/>" + Server.MapPath("~/Uploads"));
}
var backupData = new AssetBackup(); var backupData = new AssetBackup();
backupData.Id = Guid.NewGuid().ToString(); backupData.Id = Guid.NewGuid().ToString();
backupData.UserId = User.Identity.GetUserId(); backupData.UserId = User.Identity.GetUserId();