Skip to content
Zotonic
  • Start
  • Guides
  • Reference
  • Releases

Live search

Search across all Zotonic content

Type at least two characters

Results are matched against titles, summaries and topics as you type.

Notifications
  • Reference
  • Backend developer
  • Metadata
  • Media management
  • Media resource
  • Notification
  • Parse

observe_media_identify_file/2

Try to identify a file, returning a map with file properties.

Type:

first

Return:

map with binary keys, especially <<"mime">>, <<"width">>, <<"height">>, <<"orientation">>

#media_identify_file{} properties:

  • filename: file:filename_all()
  • original_filename: binary
  • extension: binary

Edit on GitHub

Related documentation

Notifications

observe_media_import_medium/2

Notification to import a medium record from external source. This is called for non-file medium records, for example embedded video. If the…

Notifications

observe_media_replace_file/2

Notification that a medium file has been changed (notify) The id is the resource id, medium contains the medium’s complete property map.

Notifications

observe_media_import/2

Notification to translate or map a file after upload, before insertion into the database Used in mod_video to queue movies for conversion…

Notifications

observe_media_update_done/2

Media update done notification. action is ‘insert’, ‘update’ or ‘delete’

Notifications

observe_media_viewer/2

Request to generate a HTML media viewer for a resource. The HTML data can not contain any Javascript, as it might be serialized. This could…

Notifications

observe_language_detect/2

Try to detect the language of a translation. Set is_editable_only to false to detect any language, even if the language is not enabled for…

Notifications

observe_resource_headers/3

Let all modules add resource specific response headers to the request. The accumulator is the list of headers to be set.

Controllers

controller_admin_media_preview

A controller for rendering preview thumbnails of any media embedded in a richtext-editor component of a resource on the…

Models

media

Access to data about uploaded files and other media.

GitHub © 2026 Zotonic