mirror of
https://github.com/lempamo/Project-Unite.git
synced 2025-01-23 01:32:16 +00:00
space is a wonderful place, time is a wonderful time
This commit is contained in:
parent
579355e512
commit
f2ab2e93fb
1 changed files with 9 additions and 1 deletions
|
@ -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");
|
||||||
System.IO.Compression.ZipFile.CreateFromDirectory(Server.MapPath("~/Uploads"), backupname);
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
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();
|
||||||
|
|
Loading…
Reference in a new issue