Пример #1
0
        public FileSystemBlobProvider(IOptions <FileSystemBlobContentOptions> options, IHttpContextAccessor httpContext)
        {
            _options = options.Value;
            if (_options.RootPath == null)
            {
                throw new PlatformException($"{ nameof(_options.RootPath) } must be set");
            }
            _storagePath = _options.RootPath.TrimEnd('\\');

            var request = httpContext.HttpContext.Request;

            _basePublicUrl = new Uri($"{ request.Scheme}://{ request.Host.Value }/{ _options.PublicPath}").ToString();
        }
Пример #2
0
        public FileSystemBlobProvider(IOptions <FileSystemBlobContentOptions> options)
        {
            _options = options.Value;
            if (_options.RootPath == null)
            {
                throw new PlatformException($"{ nameof(_options.RootPath) } must be set");
            }
            _storagePath = _options.RootPath.TrimEnd('\\');

            _basePublicUrl = _options.PublicUrl;
            if (_basePublicUrl != null)
            {
                _basePublicUrl = _basePublicUrl.TrimEnd('/');
            }
        }