26 lines
757 B
C++
26 lines
757 B
C++
#ifndef ASIDE_FILE_HPP
|
|
#define ASIDE_FILE_HPP
|
|
|
|
#include "AsideFileClass.h"
|
|
#include "../Server.h"
|
|
|
|
class AsideFile {
|
|
public:
|
|
static void ReadData(CTL::Request &request, CTL::Response &response) {
|
|
CCVar Json = request.GetJson();
|
|
CTL::String DirPath = Json.get("Path");
|
|
DirPath = CCFile::NormalizePath(RootPath + DirPath);
|
|
CCVar Data = AsideFileClass::GetData(DirPath);
|
|
CTL::JSONObject JsonData;
|
|
JsonData.put("Buffer",Data);
|
|
response.Write(JsonData.to_String(),200);
|
|
}
|
|
static void ReadDataZip(CTL::Request &request, CTL::Response &response) {
|
|
response.ResourceDownload("E:/Download/BaiduWP.exe",1024);
|
|
}
|
|
private:
|
|
inline static CTL::String RootPath = "../static/";
|
|
};
|
|
|
|
#endif
|