# observe\_media\_upload\_preprocess/2

Source: https://zotonic.com/docs/1915/observe_media_upload_preprocess-2

URI: https://zotonic.com/id/1915

Language: en



Notification to translate or map a file after upload, before insertion into the database Used in mod\_video to queue movies for conversion to mp4. You can set the post\_insert\_fun to something like fun(Id, Medium, Context) to receive the medium record as it is inserted.

Type:

[first](/id/doc_developerguide_notifications#notification-first)

Return:

modified `#media_upload_preprocess{}`

`#media_upload_preprocess{}` properties:

- id: `union`
- mime: `binary`
- file: `file:filename_all()|undefined`
- original\_filename: `file:filename_all()|undefined`
- medium: `z_media_identify:media_info()`
- post\_insert\_fun: `function|undefined`

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1915?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1915?language=en>)
