# 3. Media File

A media file is a user updateable graphic, eg image or video.

[![image.png](https://docs.tsnocode.com/uploads/images/gallery/2026-10/scaled-1680-/hUmKBOllgDQygoTw-image.png)](https://docs.tsnocode.com/uploads/images/gallery/2026-10/hUmKBOllgDQygoTw-image.png)

A media file is composed of 7 or 8 attributes:

**Type**  
The type of media.  
Default is image and video.

**A title**  
An internal title, shown when selecting the image from a dropdown.

**An image**  
The image upload field.

**An alternative image (optional)**  
An optional second image upload field.

**A video**  
The video upload field.

**The public path**  
The public path, where the media was written.

**The alternative public path**  
The public path of the generated thumbnail, or the alternative image.

**Alt text**  
The alt text displayed if the media fails to load.

This entity maked use of a codeunit named `com.tsnocode.core.cms.MediaEventHandler`.  
The codeunit is controlled via the System configuration that start with `Cms.Media.`.  
If the media is a video, then the video is re-encoded into the [defined resolutions and bitrates](https://docs.tsnocode.com/books/cms/page/3-media). This takes a while and therefore the site will be loading for a little while. A thumbnail is also generated, and that path is saved in the field "Alt Path".