mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-06 15:51:25 +00:00
Added mg_upload()
This commit is contained in:
1 parent
1ef31461bc
commit
0d442058e5
3 files changed
+127
-92
No files matched your search
+11
@@ -127,6 +127,11 @@ enum mg_event {
|
||||
// Callback's return value is ignored.
|
||||
// ev_data contains lua_State pointer.
|
||||
MG_INIT_LUA,
|
||||
|
||||
// Mongoose has uploaded file to a temporary directory.
|
||||
// Callback's return value is ignored.
|
||||
// ev_data contains NUL-terminated file name.
|
||||
MG_UPLOAD,
|
||||
};
|
||||
|
||||
|
||||
@@ -336,6 +341,12 @@ FILE *mg_fetch(struct mg_context *ctx, const char *url, const char *path,
|
||||
char *buf, size_t buf_len, struct mg_request_info *request_info);
|
||||
|
||||
|
||||
// File upload functionality. Each uploaded file gets saved into a temporary
|
||||
// file and MG_UPLOAD event is sent.
|
||||
// Return number of uploaded files.
|
||||
int mg_upload(struct mg_connection *conn, const char *destination_dir);
|
||||
|
||||
|
||||
// Convenience function -- create detached thread.
|
||||
// Return: 0 on success, non-0 on error.
|
||||
typedef void * (*mg_thread_func_t)(void *);
|
||||
|
||||
Reference in new issue
Block a user