How to override thumbnail generation of file type media? In admin/content/media I need to show file type related icons instead of generic file icon.

From this:


To this:


I tried to edit the related thumbnail field in "media" view but no option is present.

Thanks
In the media source plugin for this media type you can find the code generating the thumbnail. See the source code of the "File" media type provider.

To summarize the code, you have to put your thumbnails files for each supported MIME type in the folder configured in the "icon_base_uri" configuration (which is stored in the "media.settings.yml" configuration file).

For example, using the default "public://media-icons/generic" folder and inserting a PDF media, you have to store your thumbnail image under the name "public://media-icons/generic/application--pdf.png" for it to be detected and used.