|
@@ -235,16 +235,18 @@ void HttpServer::run_hhttp_sever()
|
|
|
filename = QString("%1/%2").arg(savePath, "monitor.xml");
|
|
filename = QString("%1/%2").arg(savePath, "monitor.xml");
|
|
|
} else if(type == "netparse") {
|
|
} else if(type == "netparse") {
|
|
|
savePath = QString("%1/%2").arg(currentPath, "storage/upload/netparse");
|
|
savePath = QString("%1/%2").arg(currentPath, "storage/upload/netparse");
|
|
|
|
|
+ filename = QString("%1/%2").arg(savePath, QString::fromStdString(item.filename));
|
|
|
} else if(type == "formula") {
|
|
} else if(type == "formula") {
|
|
|
savePath = QString("%1/%2").arg(currentPath, "storage/upload/formula");
|
|
savePath = QString("%1/%2").arg(currentPath, "storage/upload/formula");
|
|
|
|
|
+ filename = QString("%1/%2").arg(savePath, QString::fromStdString(item.filename));
|
|
|
} else if(type == "pluginadd" || type == "pluginupgrade") {
|
|
} else if(type == "pluginadd" || type == "pluginupgrade") {
|
|
|
savePath = QString("%1/%2").arg(currentPath, "storage/upload/plugins");
|
|
savePath = QString("%1/%2").arg(currentPath, "storage/upload/plugins");
|
|
|
|
|
+ filename = QString("%1/%2").arg(savePath, QString::fromStdString(item.filename));
|
|
|
} else {
|
|
} else {
|
|
|
res.status = httplib::StatusCode::BadRequest_400;
|
|
res.status = httplib::StatusCode::BadRequest_400;
|
|
|
res.set_content(R"({"message": "Invalid file type"})", "application/json");
|
|
res.set_content(R"({"message": "Invalid file type"})", "application/json");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- filename = QString("%1/%2").arg(savePath, QString::fromStdString(item.filename));
|
|
|
|
|
|
|
|
|
|
QDir dir(savePath);
|
|
QDir dir(savePath);
|
|
|
if(!dir.exists()) {
|
|
if(!dir.exists()) {
|
|
@@ -259,6 +261,8 @@ void HttpServer::run_hhttp_sever()
|
|
|
|
|
|
|
|
ofs.write(item.content.data(), item.content.size());
|
|
ofs.write(item.content.data(), item.content.size());
|
|
|
ofs.close();
|
|
ofs.close();
|
|
|
|
|
+
|
|
|
|
|
+ LOG_INFO("upload filename: {}", filename.toStdString());
|
|
|
|
|
|
|
|
if(type == "monitor") {
|
|
if(type == "monitor") {
|
|
|
LOG_INFO("monitor configure file successfully update");
|
|
LOG_INFO("monitor configure file successfully update");
|