예제 #1
0
        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);
        }
예제 #2
0
        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;
        }