MediaTypeProvider.GetMediaType(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the media type for the specified file name.
public System.Net.Http.Headers.MediaTypeHeaderValue GetMediaType (string fileName);
abstract member GetMediaType : string -> System.Net.Http.Headers.MediaTypeHeaderValue
override this.GetMediaType : string -> System.Net.Http.Headers.MediaTypeHeaderValue
Public Function GetMediaType (fileName As String) As MediaTypeHeaderValue
Parameters
- fileName
- String
The file name to determine the mapping for.
Returns
A new MediaTypeHeaderValue representing the media type for the given file name. If there is no mapping found then
a value of application/octet-stream
is returned.