Log in
Model

FileInfo

Magento\Catalog\Model\Category\FileInfo

What it does

This class provides file information and path resolution utilities for category images and media files in Magento 2.

Developers use it to check if category media files exist, get their MIME types, retrieve file statistics, and resolve file paths relative to the media directory.

It's particularly useful when handling category image uploads, validations, or when you need to work with category-related media files stored in the pub/media/catalog/category directory.

Public Methods

  • _resetState()
  • getMimeType()
  • getStat()
  • isExist()
  • isBeginsWithMediaDirectoryPath()
  • getRelativePathToMediaDirectory()