#include <webfilepage.h>
Inheritance diagram for WebFilePage:
Public Member Functions | |
DECLSPEC | WebFilePage (const char *uri, const char *fn, const char *type=NULL) |
virtual DECLSPEC int | send (WebSrvClient *client, Uint32 &responsecode) |
Protected Attributes | |
std::string | strFilename |
the filename of the file to send, when responding | |
char | chContentType [128] |
the content-type string |
By creating a WebFilePage, you can make a file being availible via HTTP.
WebFilePage::WebFilePage | ( | const char * | uri, | |
const char * | fn, | |||
const char * | type = NULL | |||
) |
Constructor. Automatically registers itself to be accessible by HTTP requests.
uri | the URI (after the IP address) of the page; when a HTTP request like http://IP-addr"uri" arrives, the function send() will be called. uri has to start with a '/'! | |
fn | the filename (relative to the app's data path) of the file, which should be sent to the requesting host. | |
type | the MIME-type, that should be sent to the requesting host (i.e. "text/html"), if NULL, the type is selected automatically by using the filename's ending. |
int WebFilePage::send | ( | WebSrvClient * | client, | |
Uint32 & | responsecode | |||
) | [virtual] |
Use this function in derived classes to respond on requests.
client | the connected client, that is requesting | |
responsecode | the return-code of the page, sent to the client (i.e. 200, when OK; 400 on error...) has to be assigned to this variable |
Reimplemented from WebPage.