implement download and open from the cloud browser
This commit is contained in:
@@ -63,6 +63,23 @@ void App::initLog()
|
||||
LogRemote::I.file_init();
|
||||
}
|
||||
|
||||
void App::download(std::string filename)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if (curl)
|
||||
{
|
||||
auto dest = data_path + "/" + filename;
|
||||
FILE* fp = fopen(dest.c_str(), "wb");
|
||||
std::string url = "http://omigamedev.ddns.net:8080/panoview/cloud-dwl.php?file=" + filename;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_data_write);
|
||||
auto err = curl_easy_perform(curl);
|
||||
curl_easy_cleanup(curl);
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
|
||||
void App::upload(std::string filename)
|
||||
{
|
||||
CURL *curl;
|
||||
|
||||
Reference in New Issue
Block a user