Пример #1
0
        public FileSystemService(PreviewService previewService, IConfiguration configuration, ILogger <FileSystemService> logger)
        {
            _rootPath          = configuration["RootFileSystemPath"];
            _logger            = logger;
            _previewService    = previewService;
            _previewFolderPath = configuration["RelativePreviewPath"];

            _logger.LogInformation("RootPath: " + _rootPath);
        }
Пример #2
0
        public FileHandle(string path, PreviewService previewService)
        {
            Path            = path;
            _previewService = previewService;

            string extension = System.IO.Path.GetExtension(Path);

            extension = extension.ToLower();

            if (_imageFileEndingsAndContentTypes.TryGetValue(extension, out var contentType))
            {
                IsImage     = true;
                ContentType = contentType;
            }
            else
            {
                ContentType = "application/octet-stream";
            }
        }