Fix file upload on windows

CL: Fix https://github.com/cesanta/mongoose/issues/962 - file upload on windows

PUBLISHED_FROM=85688eee147a1df468cca92f4ac61526ce9c02bf
This commit is contained in:
Бобби 2018-08-21 14:44:19 +01:00 committed by Cesanta Bot
parent b84981ad03
commit 955d4a3129
2 changed files with 2 additions and 2 deletions

View File

@ -8328,7 +8328,7 @@ void mg_file_upload_handler(struct mg_connection *nc, int ev, void *ev_data,
if (lfn.p != mp->file_name) MG_FREE((char *) lfn.p);
LOG(LL_DEBUG,
("%p Receiving file %s -> %s", nc, mp->file_name, fus->lfn));
fus->fp = mg_fopen(fus->lfn, "w");
fus->fp = mg_fopen(fus->lfn, "wb");
if (fus->fp == NULL) {
mg_printf(nc,
"HTTP/1.1 500 Internal Server Error\r\n"

View File

@ -2737,7 +2737,7 @@ void mg_file_upload_handler(struct mg_connection *nc, int ev, void *ev_data,
if (lfn.p != mp->file_name) MG_FREE((char *) lfn.p);
LOG(LL_DEBUG,
("%p Receiving file %s -> %s", nc, mp->file_name, fus->lfn));
fus->fp = mg_fopen(fus->lfn, "w");
fus->fp = mg_fopen(fus->lfn, "wb");
if (fus->fp == NULL) {
mg_printf(nc,
"HTTP/1.1 500 Internal Server Error\r\n"