Adds support to FILES_COMBINED_SIZE variable

This commit is contained in:
Felipe Zimmerle
2015-07-17 15:42:36 -03:00
parent e1cff89b48
commit ebb16d0439
2 changed files with 66 additions and 0 deletions

View File

@@ -205,14 +205,17 @@ bool Multipart::process(std::string data) {
start = end;
}
double files_size = 0;
for (std::string x : blobs) {
MultipartBlob m(x, this);
if (m.filename.empty() == false) {
variables.emplace("FILES:" + m.name, m.filename);
variables.emplace("FILES_NAMES:" + m.name, m.name);
files_size = files_size + m.content.size();
}
}
variables.emplace("FILES_COMBINED_SIZE", std::to_string(files_size));
return true;
}