C/C++ Reference
HttpResMgr Struct Reference

The HttpResMgr class makes it possible for HTTP clients to use an IoIntf for uploading and downloading files. More...

#include <HttpResMgr.h>

Inheritance diagram for HttpResMgr:
Collaboration diagram for HttpResMgr:

List of all members.

Public Member Functions

 HttpResMgr (IoIntf *io, int maxUploads, const char *dirName, AllocatorIntf *alloc=0, S8 priority=0)
 Initializes a HttpResMgr.
 ~HttpResMgr ()
 Terminate the HttpResMgr object.

Detailed Description

The HttpResMgr class makes it possible for HTTP clients to use an IoIntf for uploading and downloading files.

The HttpResMgr is similar in functionality to an FTP server, but uses HTTP for the transport of data.

The HttpResMgr is implemented in C code, but we also provide a Web File Manager implemented in Lua code. See the WFS documentation for more information on the Lua version.

The HttpResMgr is designed to be used from both browser clients and non-browser clients. The HttpResMgr detects the difference between a browser and non-browser client by looking at the commands sent to the HttpResMgr resource and the upload type. Please read our online and public information for how to use the HttpResMgr class from browser and non-browser clients.

The HttpResMgr can also work with "read only" IoIntf implementations such as the ZipIo, but any "write" command type is denied.

Unlike the HttpResRdr class, the HttpResMgr does not do any translations on downloaded files. The HttpResMgr should be used for file transfer and not for serving general HTML files, images, etc, to a client. A request for a directory returns a list of all resources in the directory. This is different from the HttpResRdr class, which attempts to locate the index.html file for directory requests.

For security reasons, a HttpResMgr should not be used without an authenticator.

The HttpResMgr is an example application for how to make a class that inherits from HttpDir. The HttpResMgr class can be considered a resource collection. The HttpResMgr source code and example can be found in the example/HttpResMgr directory.


Constructor & Destructor Documentation

HttpResMgr::HttpResMgr ( IoIntf io,
int  maxUploads,
const char *  dirName,
AllocatorIntf alloc = 0,
S8  priority = 0 
)

Initializes a HttpResMgr.

Parameters:
iois a IoIntf implementation such as DiskIo
maxUploadsis the limit value for concurrent uploads. The maximum numbers of downloads are controlled by the HttpCmdThreadPool. See the limitations section in HttpResRdr for more information on how the download works.
dirNameis the HttpDir name.
allocis the allocator used when allocating "concurrent upload" objects.
priorityis the HttpDir priority
HttpResMgr::~HttpResMgr ( )

Terminate the HttpResMgr object.

Please note that any upload in progress will be aborted.