====== 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. ===== 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 ===== Plugins handling this event ===== The following plugins are known to handle this event and their source code may be a good start for understanding and implementing a handler yourself. * [[plugin:dlcount]], [[plugin:ireflect]], [[plugin:svgimg2]], [[plugin:siteexport]] ===== See also ===== * [[devel:Action Plugins]] * [[devel:Events]]