diff --git a/DeviceConnection.cpp b/DeviceConnection.cpp index a7fc53c..4be6fec 100644 --- a/DeviceConnection.cpp +++ b/DeviceConnection.cpp @@ -1,6 +1,7 @@ #include "DeviceConnection.h" #include "BoostLog.h" #include "StringUtility.h" +#include #include #include #include @@ -362,7 +363,8 @@ void DeviceConnection::requestOta(const QString &firmware, const QString &file) request["deviceid"] = "0"; boost::json::object data; data["target_linux04_firmware"] = firmware.toStdString(); - data["datasize"] = std::filesystem::file_size(file.toStdString()); + QFileInfo fileInfo(file); + data["datasize"] = fileInfo.size(); data["md5"] = oss.str(); request["data"] = std::move(data); auto text = boost::json::serialize(request);