diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 9fecd4c48..c121a65be 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -1733,6 +1733,17 @@ std::string genTmpName(std::string suffix,unsigned int length) return Str; } +std::string dlTmpName(std::string url) +{ + if (strstr(url.c_str(), "://")) + { + std::string tmpname = genTmpName(url.substr(url.find_last_of(".")+1),10); + if (downloadUrl(url,tmpname)) + url = tmpname; + } + return url; +} + // curl static void *myrealloc(void *ptr, size_t size) { diff --git a/src/system/helpers.h b/src/system/helpers.h index b626d50e7..1e05e00e0 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -164,6 +164,7 @@ std::string iso_8859_1_to_utf8(std::string &str); bool utf8_check_is_valid(const std::string &str); std::string genTmpName(std::string suffix,unsigned int length); +std::string dlTmpName(std::string url); // curl struct MemoryStruct {