Despite my efforts, I'm feeling tired as none of the solutions seem to work for me.
Here is the HTTP call in Angular that I am struggling with:
$http({
method: 'GET',
url: API_URL + 'v1/file/' + candidateId + '/download',
headers: {
'authToken': AuthService.getToken(),
},
responseType: 'arraybuffer'
})
.then(function onSuccess(response) {
successCallback(response);
},
function onError(response) {
errorCallback(response);
});
Within the Success function of this code:
vm.onSuccessDownloadResume = function(response) {
var blob = new Blob([response.data], {type: response.headers('content-type')});
var objectUrl = URL.createObjectURL(blob);
window.open(objectUrl);
};
I have attempted using webkitURL.createObjectURL(blob), which works fine in Chrome, but unfortunately URL.createObject is not functioning at all.
The error message read: URL.createObjectURL() is not a function()
Thank you.