Class FileExtensionContentTypeProvider
Provides a mapping between file extensions and MIME types.
Inheritance
System.Object
FileExtensionContentTypeProvider
Namespace: PnP.Framework.Utilities
Assembly: PnP.Framework.dll
Syntax
public class FileExtensionContentTypeProvider : object
Constructors
FileExtensionContentTypeProvider()
Creates a new provider with a set of default mappings.
Declaration
public FileExtensionContentTypeProvider()
FileExtensionContentTypeProvider(IDictionary<String, String>)
Creates a lookup engine using the provided mapping. It is recommended that the IDictionary instance use StringComparer.OrdinalIgnoreCase.
Declaration
public FileExtensionContentTypeProvider(IDictionary<string, string> mapping)
Parameters
IDictionary<System.
|
Properties
Mappings
The cross reference table of file extensions and content-types.
Declaration
public IDictionary<string, string> Mappings { get; }
Property Value
IDictionary<System.
|
Methods
TryGetContentType(String, out String)
Given a file path, determine the MIME type
Declaration
public bool TryGetContentType(string subpath, out string contentType)
Parameters
System. A file path |
System. The resulting MIME type |
Returns
System. True if MIME type could be determined |