observe_media_upload_prepare/3

Notification to compose upload transformations after sanitization and before archival. The folded accumulator is a #media_upload_preprocess{} record or an error. Observers must propagate errors unchanged. Replacement files must be written inside temp_dir, which core cleans up after archival or failure.

Type:

foldl

Return:

modified #media_upload_preprocess{} or {error, Reason}

#media_upload_prepare{} properties:

  • options: list
  • temp_dir: file:filename_all()

Edit on GitHub

Observed by

Modules

mod_media_exif

When uploading a file, this module extracts properties from the uploaded media and sets them in the resource.