I doing a WebView android application to downloaded file and save it into my mobile device. But its the file can be downloaded but didn't save into my device. please help me.
function downloadContentVersion(nodeId, version) { var url = ''; self.getDownloadUrl(nodeId, version ? version.version : null).then(function (response) { url = response.data.data.contentUrl; alert('hi 1');
retu $http({
'method': 'GET',
'responseType': 'arraybuffer',
'url': config.basePath + url.substring(url.indexOf('/downloadURL'))
});
}).then(function (response) {
if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) {
window.open( config.basePath + url, '_blank');
} else {
var blob = new Blob([response.data], {
type: response.headers("Content-Type")
});
saveAs(blob, version ? version.filename : extractFileName(response));
}
});
}
