I'm trying to download a file (uploaded before in a swift container (openstack)) when I click on the link on my webpage interface. The file is found when I display "res" but it's not downloaded (with my browser : "Fail = No File") and and I don't know why .. Should I use "html.response" ?
ps: interceptDownload is used by the "ostrio:file" package.
I'm using this code :
interceptDownload(http, image, versionName) {
var options = {
container: 'openstack',
remote: 'logo.png'
};
var stream = client.download(options, function(err, res) {
if(err) {
console.log(err);
} else {
console.log(res);
}
}).pipe(fs.createWriteStream('file.txt'));
},