open file with binary mode

This commit is contained in:
vimer 2023-05-19 11:29:44 +08:00
parent f68205f113
commit b6dfd5842d

View File

@ -435,7 +435,7 @@ void TC_Cgi::parseFormData(multimap<string, string> &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");