Nucleus .Net Core CMS

FileExtensions Class

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


EncodeFileId (File) Method

EncodeFileId (File file)
Return an encoded file id for the specified file.
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.
Name Type
fileId Guid

DecodeFileId (String) Method

DecodeFileId (String encodedPath)
Return a decoded file path for the specified encoded path.
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.
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 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.