0
我试图通过连接到猫鼬web服务器的web GUI下载压缩文件。我想通了幼稚的方法是将ifstream的传递到ostream的响应:从猫鼬服务器下载tar.gz
...
std::stringstream zip_location;
zip_location << path << "/" << timestamp << ".tar.gz";
std::ifstream zip_file(zip_location.str());
if(zip_file){
// Enters here fine
request.set_response_content_type("application/x-tar-gz");
request.add_response_header(new http_header_fields::cache_control_no_cache);
request.out() << zip_file;
return true;
}
...
但是,我得到的回应只是一个编码字符串:MHg3ZjRmYTk5Y2RhYjA=
,但我想浏览器下载的zip文件。
值得注意的是,我使用的是猫鼬的旧版本,我似乎无法在examples中找到任何解决方案。