Nucleus .Net Core CMS

FileExtensions Class

Namespace: Nucleus.Extensions
Assembly: Nucleus.Extensions.dll
File extensions
DecodeFileId (String encodedPath)
Return a decoded file path for the specified encoded path.
Parameters
Name Type
encodedPath String
EncodeFileId (File file)
Return an encoded file id for the specified file.
Remarks
Inline and un-encoded file links are not supported for file links specified by file id only.
EncodeFileId (Guid fileId)
Return an encoded file id for the specified file id.
Parameters
Name Type
fileId Guid
GetImageDimensions (File file, Site site, IFileSystemManager fileSystemManager)
Retrieve the height and width of the file (if its file extension indicates that it is an image) and set the height/width properties of the specified file.
Returns
Returns true on success, or false if the file extension does not indicate that the file is an image, or there is an error rendering the image.
GetMIMEType (File file, Boolean addCharset)
Return the content type for the file, or application/octet-stream if the file extension was not matched to a MIME type.
Parameters
Name Type
file Nucleus.Abstractions.Models.FileSystem.File
addCharset Boolean

Specifies whether to append charset=utf-8 to the MIME type for text and javascript files.