added update
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Waiting to run
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Waiting to run
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Waiting to run
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Waiting to run
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Waiting to run
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Waiting to run
This commit is contained in:
1 parent
e115578b57
commit
65b29b105f
7 files changed
+60
-1
No files matched your search
@@ -0,0 +1,20 @@
|
||||
#include <system/update/update.hpp>
|
||||
#include <types.hpp>
|
||||
|
||||
namespace api
|
||||
{
|
||||
namespace system
|
||||
{
|
||||
void upload(const httplib::Request& request, httplib::Response& response) {
|
||||
std::size_t size = request.files.size();
|
||||
std::cout << "file size::" << size << std::endl;
|
||||
bool ret = request.has_file("image");
|
||||
std::cout << "file ret::" << ret << std::endl;
|
||||
const httplib::MultipartFormData& file = request.get_file_value("restore_settings");
|
||||
std::ofstream tmp_image_file("/tmp/image");
|
||||
tmp_image_file << file.content;
|
||||
tmp_image_file.close();
|
||||
response.set_content(R"({"status":true})", JSON_TYPE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <httplib.h>
|
||||
|
||||
namespace api
|
||||
{
|
||||
namespace system
|
||||
{
|
||||
void upload(const httplib::Request& request, httplib::Response& response);
|
||||
// void update(const httplib::Request& request, httplib::Response& response);
|
||||
// void progress(const httplib::Request& request, httplib::Response& response);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user