mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-19 19:40:56 +00:00
In mg_upload(), use fopen() with "wb" mode instead of "wbx", cause "x" is not understood by Mac and Windows.
This commit is contained in:
1 parent
fcbc36ecde
commit
1fb6f391a1
1 file changed
+2
-2
+2
-2
@@ -4141,9 +4141,9 @@ int mg_upload(struct mg_connection *conn, const char *destination_dir) {
|
|||||||
if ((s = strrchr(fname, '/')) == NULL) {
|
if ((s = strrchr(fname, '/')) == NULL) {
|
||||||
s = fname;
|
s = fname;
|
||||||
}
|
}
|
||||||
// Open file in binary mode with exclusive lock set
|
// Open file in binary mode. TODO: set an exclusive lock.
|
||||||
snprintf(path, sizeof(path), "%s/%s", destination_dir, s);
|
snprintf(path, sizeof(path), "%s/%s", destination_dir, s);
|
||||||
if ((fp = fopen(path, "wbx")) == NULL) {
|
if ((fp = fopen(path, "wb")) == NULL) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user