devel:event:fetch_media_status
Table of Contents
FETCH_MEDIA_STATUS
- Description:
- handles status codes when downloading a media resource
- DefaultAction:
- process 300-304 with redirect, send 200 OK and output a status message for >=203
- Preventable:
- yes
- Added:
- 2010-02-23
This event can be used to process the status codes for a media resource request in lib/exe/fetch.php. It can be used to redirect users to an error page for media resources not being found or to accept arbitrary resource requests and send convenient files back. This is processed before the MEDIA_SENDFILE and offers a BEFORE and an AFTER processing 1).
Passed Data
- $data['media'] – The id for the called file
- $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['download'] – Whether the file is to be downloaded or displayed inline
- $data['cache'] – The wanted cache behavior (-1 = cache forever, 0 = never cache, >0 cache time in seconds), can be modified by your plugin
- $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
- $data['status'] – The current status code of the request
- $data['statusmessage'] – The status message corresponding to the status above
See also
- Code related to this event used in any DokuWiki's files, plugins and templates
1)
AFTER is only fired for a HTTP status lower than 204
devel/event/fetch_media_status.txt · Last modified: 2018-12-08 15:18 by torpedo