in my angular application I need to download a zip file, the download starts regularly, but the client download a corrupted zip file, whose size is only 15 byte. this is the code for the request:
$http.post('/api/download/',data, {
dataType : "binary",
processData : false,
accept:'application/zip',
Encoding: 'gzip',
responseType:'arraybuffer'})
this is how I handle the successful response:
function() {
var data = {}
data.files = $scope.selectedFiles
FileService.download(data,function(resp){
var blob = new Blob([resp], {type: "application/octet-stream"})
console.log('response',resp)
FileSaver.saveAs(blob,'registrazioni.zip',(err) => {
console.log('saved success,error',err);
})
})
}
I read many similar questions, but theirs solutions do not apply to me