It's better when it's simple

User Tools

Site Tools



execute an action on file uploads
store the uploaded file

This event is signalled by media_upload() in inc/media.php. Use this to inspect/change/modify uploaded files.

Passed Data

$data contains an array which hold various informations about the uploaded file:

  • data[0] path/to/new/media.file (normally read from $_FILES, potentially could come from elsewhere)
  • data[1] file name of the file being uploaded
  • data[2] future directory id of the file being uploaded
  • data[3] the mime type of the file being uploaded
  • data[4] true if the uploaded file exists already
  • data[5] (since 2011-02-06) the PHP function used to move the file to the correct location


This event is used when adding/replacing media files and is designed to be independent of the mechanism used to transfer the media file to the wiki server. Currently, within standard DokuWiki, this only happens by browser upload - however it should not be assumed this will always be the case.

See also

devel/event/media_upload_finish.txt · Last modified: 2018-12-08 15:53 by torpedo

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki