コード例 #1
0
        /// <summary>
        /// Move the image from temp to the permanent location.
        /// </summary>
        /// <param name="uploadsPath">The path to the Uploads folder.</param>
        public void MovePermanently(string uploadsPath)
        {
            var fileName             = Path.GetFileName(PathOnDisk);
            var newOriginalLocation  = Path.Combine(uploadsPath, FileSystemFacade.ORIGINALS, fileName);
            var newThumbnsilLocation = Path.Combine(uploadsPath, FileSystemFacade.THUMBNAILS, fileName);

            FileSystemFacade.MoveFileToLocation(PathOnDisk, newOriginalLocation);
            FileSystemFacade.MoveFileToLocation(ThumbnailPathOnDisk, newThumbnsilLocation);
            PathOnDisk          = newOriginalLocation;
            ThumbnailPathOnDisk = newThumbnsilLocation;
        }