From b6dfd5842ddd343513e0b43d4985fc039b8b6675 Mon Sep 17 00:00:00 2001 From: vimer Date: Fri, 19 May 2023 11:29:44 +0800 Subject: [PATCH] open file with binary mode --- util/src/tc_cgi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/src/tc_cgi.cpp b/util/src/tc_cgi.cpp index de80a81..92c95ab 100644 --- a/util/src/tc_cgi.cpp +++ b/util/src/tc_cgi.cpp @@ -435,7 +435,7 @@ void TC_Cgi::parseFormData(multimap &mmpParams, const string &sB sTheFile = sName; //打开文件 - if ( (fp = fopen(sUploadFileName.c_str(),"w")) == NULL) + if ( (fp = fopen(sUploadFileName.c_str(),"wb")) == NULL) { mmpParams.clear(); //clear , exception safe THROW_EXCEPTION_SYSCODE(TC_Cgi_Exception, "[TC_Cgi::parseFormData] Upload File '" + sValue + "' to '" + sUploadFileName +"' error");