|
Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
|
#include "HttpUpload.h"
Go to the source code of this file.
Classes | |
| struct | HttpResMgr |
| The HttpResMgr class makes it possible for HTTP clients to use an IoIntf for uploading and downloading files. More... | |
Macros | |
| #define | HttpResMgr_setAuthenticator(o, authenticator, realm) HttpDir_setAuthenticator((HttpDir*)o, authenticator, realm) |
| Attach authentication using HttpDir_setAuthenticator. More... | |
Typedefs | |
| typedef HttpResMgr | HttpResMgr |
| The HttpResMgr class makes it possible for HTTP clients to use an IoIntf for uploading and downloading files. More... | |
Functions | |
| void | HttpResMgr_constructor (HttpResMgr *o, IoIntf *io, int maxUploads, const char *dirName, AllocatorIntf *alloc, S8 priority) |
| Initialize the file manager; see HttpResMgr::HttpResMgr. More... | |
| void | HttpResMgr_destructor (HttpResMgr *o) |
| Abort active uploads without freeing this object or borrowed dependencies. More... | |
| #define HttpResMgr_setAuthenticator | ( | o, | |
| authenticator, | |||
| realm | |||
| ) | HttpDir_setAuthenticator((HttpDir*)o, authenticator, realm) |
Attach authentication using HttpDir_setAuthenticator.
| [in,out] | o | Initialized manager. |
| [in] | authenticator | Borrowed AuthenticatorIntf pointer, valid while attached, or NULL. |
| [in] | realm | Borrowed AuthorizerIntf pointer, valid while attached, or NULL. Despite the macro parameter name, this is not a realm string. |
| typedef HttpResMgr HttpResMgr |
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.
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.
| void HttpResMgr_constructor | ( | HttpResMgr * | o, |
| IoIntf * | io, | ||
| int | maxUploads, | ||
| const char * | dirName, | ||
| AllocatorIntf * | alloc, | ||
| S8 | priority | ||
| ) |
Initialize the file manager; see HttpResMgr::HttpResMgr.
| [out] | o | Caller-owned manager storage. |
| [in] | io | Borrowed I/O interface, valid throughout use. |
| [in] | maxUploads | Concurrent request limit; nonpositive values select one. |
| [in] | dirName | Borrowed directory name, valid throughout use, or NULL. |
| [in] | alloc | Borrowed allocator, or NULL for the default. |
| [in] | priority | Signed directory priority. |
| void HttpResMgr_destructor | ( | HttpResMgr * | o | ) |
Abort active uploads without freeing this object or borrowed dependencies.
| [in,out] | o | Initialized manager whose incoming requests have stopped. Follow HttpDir lifecycle rules to detach and destroy the directory itself. |