コード例 #1
0
        public static SaveResult MoveContentFromTemp(Guid userId, string fromFileName, string toFileName, string configLocation, WikiSection section, int tenantId, HttpContext context, string rootFile, out string _fileName)
        {
            var storage = StorageFactory.GetStorage(configLocation, tenantId.ToString(), section.DataStorage.ModuleName, context);

            var fileName     = toFileName;
            var fileLocation = GetFileLocation(fileName);
            var file         = new File
            {
                FileName       = fileName,
                UploadFileName = fileName,
                UserID         = userId,
                FileLocation   = fileLocation,
                FileSize       = (int)storage.GetFileSize(section.DataStorage.TempDomain, fromFileName),
            };

            var wiki = new WikiEngine();

            wiki.SaveFile(file);

            storage.Move(section.DataStorage.TempDomain, fromFileName, section.DataStorage.DefaultDomain, fileLocation);
            _fileName = file.FileName;

            return(SaveResult.Ok);
        }
コード例 #2
0
        public static SaveResult MoveContentFromTemp(Guid UserId, string fromFileName, string toFileName, string configLocation, WikiSection section, int tenantId, HttpContext context, string rootFile, out string _fileName)
        {
            var storage = StorageFactory.GetStorage(configLocation, tenantId.ToString(), section.DataStorage.ModuleName, context);

            var fileName = toFileName;
            var fileLocation = GetFileLocation(fileName, section, rootFile);
            var file = new File
                           {
                               FileName = fileName,
                               UploadFileName = fileName,
                               UserID = UserId,
                               FileLocation = fileLocation,
                               FileSize = (int) storage.GetFileSize(section.DataStorage.TempDomain, fromFileName),
                           };

            var wiki = new WikiEngine();
            wiki.SaveFile(file);

            storage.Move(section.DataStorage.TempDomain, fromFileName, section.DataStorage.DefaultDomain, fileLocation);
            _fileName = file.FileName;

            return SaveResult.Ok;
        }