public EntityFileOperationResult Save(Models.EntityFile entityFile, string folderName) { var result = new EntityFileOperationResult(); if (entityFile.Data.Length > 0) { var physicalPath = Path.Combine(DataDir.DataPhysicalPath, folderName, entityFile.FileName); var virtualPath = UrlUtility.Combine(DataDir.DataVirutalPath, folderName, entityFile.FileName); entityFile.Data.SaveAs(physicalPath); result.PhysicalPath = physicalPath; result.VirtualPath = virtualPath; } return(result); }
public EntityFileOperationResult Save(Models.EntityFile entityFile, string folderName) { var result = new EntityFileOperationResult(); if (entityFile.Data.Length > 0) { var physicalPath = Path.Combine(DataDir.DataPhysicalPath, folderName, entityFile.FileName); var virtualPath = UrlUtility.Combine(DataDir.DataVirutalPath, folderName, entityFile.FileName); entityFile.Data.SaveAs(physicalPath); result.PhysicalPath = physicalPath; result.VirtualPath = virtualPath; } return result; }