39#ifndef __HttpMultipartUpload_h
40#define __HttpMultipartUpload_h
42#include "HttpServer.h"
43#include "BaServerLib.h"
56 MultipartUpload_NoError=0,
57 MultipartUpload_ConnectionTerminated=-100,
58 MultipartUpload_NoMemory,
59 MultipartUpload_ParseError1,
60 MultipartUpload_ParseError2,
61 MultipartUpload_ParseError3,
62 MultipartUpload_ParseError4,
63 MultipartUpload_ParseError5,
64 MultipartUpload_ParseError6,
65 MultipartUpload_UserRetErr
119 const char* fileName,
120 const char* contentType,
121 const char* contentTransferEncoding);
153 MultipartUpload_ReadBoundaryTag,
154 MultipartUpload_ReadHeaders,
155 MultipartUpload_ReadFormData,
156 MultipartUpload_ReadFileData
157} MultipartUpload_States;
270 DoubleList boundaryStack;
281 char* contentTransferEncoding;
284 MultipartUpload_States state;
292 BaBool newBoundaryTag;
293 BaBool copyingHttpReqData;
301BA_API MultipartUpload_constructor(
313BA_API
int MultipartUpload_run(
316#define MultipartUpload_getServer(o) \
317 HttpConnection_getServer((HttpConnection*)(o))
320inline MultipartUpload::MultipartUpload(
329 MultipartUpload_constructor(
this, server, endOfReq, formData,
330 fileBegin, fileData, onError, size, allocator);
333 MultipartUpload_destructor(
this);
336 return MultipartUpload_start(
this,req);
338inline int MultipartUpload::run(
HttpRequest *req,
bool setKeepAlive) {
339 return MultipartUpload_run(
this,req,setKeepAlive?TRUE:FALSE);
342 return MultipartUpload_getCon(
this); }
344 return MultipartUpload_getServer(
this);
struct MultipartUpload MultipartUpload
The MultipartUpload, which is an abstract base class, implements the functionality as specified in RF...
int(* MultipartUpload_FileData)(struct MultipartUpload *o, const U8 *data, U16 len)
Executed by MultipartUpload when a data chunk is available.
Definition: MultipartUpload.h:135
HttpConnection * getCon(MultipartUpload *o)
Returns the internal active connection object.
Definition: MultipartUpload.h:341
~MultipartUpload()
Release buffers used during parsing the multipart stream.
Definition: MultipartUpload.h:332
void(* MultipartUpload_EndOfReq)(struct MultipartUpload *o)
Executed by MultipartUpload when a multipart upload is completed.
Definition: MultipartUpload.h:78
int(* MultipartUpload_FormData)(struct MultipartUpload *o, const char *name, const char *value)
Executed by MultipartUpload every time a form data element such as "text" is found in the multipart d...
Definition: MultipartUpload.h:95
void(* MultipartUpload_Error)(struct MultipartUpload *o, MultipartUpload_ErrorType e)
Executed by MultipartUpload if any errors are detected during parsing of the multipart data stream.
Definition: MultipartUpload.h:146
HttpServer * getServer()
Get the HttpServer instance.
Definition: MultipartUpload.h:343
int(* MultipartUpload_FileBegin)(struct MultipartUpload *o, const char *name, const char *fileName, const char *contentType, const char *contentTransferEncoding)
Executed by MultipartUpload when a file is found in the multipart data stream.
Definition: MultipartUpload.h:116
MultipartUpload_ErrorType
Error codes used by the callback function MultipartUpload_Error in interface class MultipartUpload.
Definition: MultipartUpload.h:55
int start(HttpRequest *req)
Start receiving data asynchronously.
Definition: MultipartUpload.h:335
Memory allocation and deallocation Interface class.
Definition: AllocatorIntf.h:83
Contains information about the physical socket connection.
Definition: HttpConnection.h:76
The HttpServer creates an HttpRequest object when the HttpServer parses a client request.
Definition: HttpServer.h:808
The Web Server.
Definition: HttpServer.h:2864
The MultipartUpload, which is an abstract base class, implements the functionality as specified in RF...
Definition: MultipartUpload.h:188