When a user clicks on a button, a zip file will be downloaded. I have the necessary components in place, but I am struggling to ensure they work together seamlessly.
The "GET" call will retrieve byte content with the content type specified as application/x-zip-compressed
, and the content disposition set as attachment
with the filename xxxx.zip
$(".downloadBtn").on("click", function(){
$.ajax({
headers: {
"xxxx" : "3.0"
},
type: "GET",
url: url,
success: function(data) {
// perform actions with the data
},
error: function(eData) {
console.log(eData);
}
});
});