docs.roxen.comView this page in a printer friendly mode
DocsRoxenWebServer 5.4System Developer Manual PikeThe Roxen Module API
Copyright © 2018, Roxen Internet Software
Suggestions, comments & compliments
manuals@roxen.com
 DEMO  DOCS  PIKE
 COMMUNITY  DOWNLOAD
www.roxen.com

   

Introduction to Roxen Modules
The Module Type Calling Sequence
Constants Common to All Modules
Callback Methods Common to All Modules
API Methods Common to All Modules
Module Variables
Tag Modules
Location (Filesystem) Modules
File Extension Modules
Filter Modules
Authentication Modules
Logger Modules
First Modules
Last Modules
Provider Modules
Content Type Modules
Directory Listing Modules

File Extension Modules

File extension modules handle one or several different file types. A file extension module is called after a location, or other module type, has returned a Stdio.File object with the correct extension.

The module type constant is MODULE_FILE_EXTENSION.

array(string) query_file_extensions()

Returns an array of strings containing the extensions this module handles. It should be configurable by the user, the easiest way would be to use a configuration variable of TYPE_STRING_LIST.

mapping handle_file_extension( Stdio.File file, string ext, RequestID id )

The method that will be called to do the actual work. file is the file object that a previous module returned. ext is the extension of the request, id the request information object. The return value is a response mapping.