added: parser for multipart forms, files: postmultiparser.h postmultiparser.cpp

added: function: upload




git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@543 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-01-06 19:17:53 +00:00
parent 60fccea703
commit 81faca041a
22 changed files with 1016 additions and 132 deletions

View File

@@ -181,6 +181,9 @@ void Content::MakeStandardFunction()
else
if( request.pfunction->code == FUN_CREATETHREAD )
FunCreateThread();
else
if( request.pfunction->code == FUN_UPLOAD )
FunUpload();
else
request.status = Error::permision_denied;
@@ -238,6 +241,10 @@ void Content::MakePost()
PostFunCreateThread();
break;
case FUN_UPLOAD:
PostFunUpload();
break;
default:
log << log1 << "Content: unknown post function" << logend;
break;
@@ -464,3 +471,27 @@ void Content::CheckGetPostTimes(time_t difference)
log << log1 << "Content: spam +1: POST after GET sent too fast" << logend;
}
/*
bool Content::CreateFile(const std::string & path, const std::string & content)
{
std::ofstream file(path.c_str(), std::ios_base::binary | std::ios_base::out);
if( !file )
{
log << log1 << "Content: can't create file: " << path << logend;
return false;
}
file << content;
file.close();
// !! dodac sprawdzenie prawidlowosci zapisania pliku
return true;
}
*/