Nucleus .Net Core CMS

FileExtensions Class

Namespace: Nucleus.Extensions
Assembly: Nucleus.Extensions.dll
File extensions

Methods

EncodeFileId (File) Method

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) Method

EncodeFileId (Guid fileId)
Return an encoded file id for the specified file id.
Parameters
Name Type
fileId Guid

DecodeFileId (String) Method

DecodeFileId (String encodedPath)
Return a decoded file path for the specified encoded path.
Parameters
Name Type
encodedPath String

GetMIMEType (File,Boolean) Method

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.

GetImageDimensions (File,Site,IFileSystemManager) Method

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.