mirror of
https://github.com/cesanta/mongoose.git
synced 2025-06-07 01:07:19 +08:00
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:
parent
b84981ad03
commit
955d4a3129
@ -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"
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user