mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-06 15:51:25 +00:00
Fix mg_http_upload()
This commit is contained in:
1 parent
6d46ecaa6c
commit
30d6a44b0d
3 files changed
+54
-2
No files matched your search
+3
-1
@@ -865,7 +865,9 @@ int mg_http_upload(struct mg_connection *c, struct mg_http_message *hm,
|
||||
if (name[0] == '\0') {
|
||||
mg_http_reply(c, 400, "", "%s", "name required");
|
||||
res = -1;
|
||||
} else if (hm->body.len > 0) {
|
||||
} else if (hm->body.len == 0) {
|
||||
mg_http_reply(c, 200, "", "%d", res); // Nothing to write
|
||||
} else {
|
||||
struct mg_fd *fd;
|
||||
long oft = strtol(offset, NULL, 0);
|
||||
mg_snprintf(path, sizeof(path), "%s%c%s", dir, MG_DIRSEP, name);
|
||||
|
||||
Reference in new issue
Block a user