====== MEDIA_SENDFILE ====== ---- dataentry event ---- Description: manipulate media file downloads from the wiki DefaultAction: send the file to the user's browser Preventable: yes Added_dt: 2008-06-23 ---- This event wraps around the [[xref>sendFile()]] function in [[xref>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 ===== * [[codesearch>MEDIA_SENDFILE|Code related to this event]] used in any DokuWiki's files, plugins and templates * [[devel:Action Plugins]] * [[devel:Events]]