ws curl -O mingw compile fix + detect when we cannot extract a filename from the url to save file to disk with -O option
This commit is contained in:
parent
056b02a494
commit
39b2a3d6df
10
ws/ws.cpp
10
ws/ws.cpp
@ -1427,10 +1427,16 @@ namespace ix
|
|||||||
filename = output;
|
filename = output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (filename.empty())
|
||||||
|
{
|
||||||
|
spdlog::error("Cannot save content to disk: No output file supplied, and not filename could be extracted from the url {}", url);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
spdlog::info("Writing to disk: {}", filename);
|
spdlog::info("Writing to disk: {}", filename);
|
||||||
std::ofstream out(filename);
|
std::ofstream out(filename);
|
||||||
out.write((char*) &response->body.front(), response->body.size());
|
out << response->body;
|
||||||
out.close();
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user