Class MediaFileHelper
- Namespace
- Geotab.Checkmate.ObjectModel.Files
- Assembly
- Geotab.Checkmate.ObjectModel.dll
Stores accepted MediaFile extensions and related methods
public static class MediaFileHelper
- Inheritance
-
MediaFileHelper
- Inherited Members
Methods
GetAllSupportedTypes()
Returns all Supported Image, Video and Applicaion types in one HashSet
public static HashSet<string> GetAllSupportedTypes()
Returns
GetContentTypeByExtension(string)
Returns the Content type based on extension passed to it
public static string GetContentTypeByExtension(string extension)
Parameters
extension
stringThe extension.
Returns
- string
contentType - "{image/video/application}/{extension}"
GetMediaTypeFromExtension(string)
Get the MediaType from a provided extension
public static MediaType GetMediaTypeFromExtension(string extension)
Parameters
extension
stringThe extension.
Returns
ValidateRequest(string, string)
Ensures that the content type matches the extension. Throws an error if does not match
public static void ValidateRequest(string extension, string contentType)