コード例 #1
0
        public async Task FileStorageGetMimeTypeFromExtension()
        {
            var downloader = new MimeTyper(true, MimeTyperLoadMode.File);
            var ext        = await downloader.GetMimeTypeFromExtension("logo-finaleaaa.svg");

            Assert.Equal("image/svg+xml", ext);
        }
コード例 #2
0
        public async Task FileStorageGetMimeTypeFromCommonExtension()
        {
            var downloader = new MimeTyper(true, MimeTyperLoadMode.File);
            var ext        = await downloader.GetMimeTypeFromExtension("logo-finaleaaa.docx");

            Assert.Equal("application/vnd.openxmlformats-officedocument.wordprocessingml.document", ext);
        }
コード例 #3
0
        public async Task GetMimeTypeFromExtension()
        {
            var downloader = new MimeTyper();
            var ext        = await downloader.GetMimeTypeFromExtension("logo-finaleaaa.svg");

            Assert.Equal("image/svg+xml", ext);
        }
コード例 #4
0
        public async Task FileStorageGetMimeTypeFromCustomExtension()
        {
            var downloader = new MimeTyper(true, MimeTyperLoadMode.File);
            await downloader.AddCustomMimeType(new MimeTyperItem { Extension = "purple", MimeType = "application/purplesoft-io" });

            var ext = await downloader.GetMimeTypeFromExtension("logo-finaleaaa.purple");

            Assert.Equal("application/purplesoft-io", ext);
        }