mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-03 13:28:44 +00:00
Fix #1210 - on win32, open upload file in binary mode
This commit is contained in:
1 parent
7eb998891e
commit
6827972f71
3 files changed
+7
-3
No files matched your search
+1
-1
@@ -271,7 +271,7 @@ int mg_http_upload(struct mg_connection *c, struct mg_http_message *hm,
|
||||
snprintf(path, sizeof(path), "%s%c%s", dir, MG_DIRSEP, name);
|
||||
LOG(LL_DEBUG,
|
||||
("%p %d bytes @ %d [%s]", c->fd, (int) hm->body.len, (int) oft, name));
|
||||
if ((fp = fopen(path, oft == 0 ? "wb" : "a")) == NULL) {
|
||||
if ((fp = fopen(path, oft == 0 ? "wb" : "ab")) == NULL) {
|
||||
mg_http_reply(c, 400, "", "fopen(%s): %d", name, errno);
|
||||
return -2;
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user