DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:event:media_sendfile

Table of Contents

MEDIA_SENDFILE

Description:
manipulate media file downloads from the wiki
DefaultAction:
send the file to the user's browser
Preventable:
yes
Added:
2008-06-23

This event wraps around the sendFile() function in lib/exe/fetch.php. Can be used to intercept or modify downloaded files and images.

Please note that the AFTER event may not be emitted when a “304 - not modified” status is sent or the file sent through X-SendFile.

Passed Data

  • $data['file'] – The filename of the file about to be delivered, can be modified by your plugin
  • $data['mime'] – The Mime-Type of the file, can be modified by your plugin
  • $data['cache'] – The wanted cache behavior (-1 = cache forever, 0 = never cache, >0 cache time in seconds), can be modified by your plugin
  • $data['orig'] – Images only: filename before resizing
  • $data['ext'] – Extension of the file
  • $data['width'] – Images only: the wanted width as specified in the request
  • $data['height'] – Images only: the wanted height as specified in the request

See also

devel/event/media_sendfile.txt · Last modified: 2018-12-08 15:52 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