31 if (
upload->uploadedFiles().size() > 0)
33 for (
const auto& file :
upload->uploadedFiles())
35 Wt::log(
"info") << file.spoolFileName();
36 std::string savePath = getAssetPath() +
"WebUploadFiles/" + file.clientFileName();
37 std::string tempFilePath = file.spoolFileName();
38 std::ifstream src(tempFilePath, std::ios::binary);
39 std::ofstream dst(savePath, std::ios::binary);
45 Wt::WMessageBox::show(
"Success",
"File save path WebUploadFiles/.", Wt::StandardButton::Ok);
49 Wt::WMessageBox::show(
"Error",
"File save failure.", Wt::StandardButton::Ok);
65 std::string removeStr = getAssetPath();
66 size_t pos = str.find(removeStr);
67 while (pos != std::string::npos)
69 str.erase(pos, removeStr.length());
70 pos = str.find(removeStr);