single file cloud upload

This commit is contained in:
2017-11-06 22:19:24 +00:00
parent fc402d584a
commit 33ea544f0b
6 changed files with 72 additions and 38 deletions

View File

@@ -80,7 +80,7 @@ void App::download(std::string filename)
}
}
void App::upload(std::string filename)
void App::upload(std::string filename, std::string name)
{
CURL *curl;
@@ -100,7 +100,8 @@ void App::upload(std::string filename)
if (curl)
{
curl_easy_setopt(curl, CURLOPT_URL, "http://omigamedev.ddns.net:8080/panoview/upl.php");
std::string url = "http://omigamedev.ddns.net:8080/panoview/cloud-upl.php?name=" + name;
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &res);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_data_handler);