I am trying to download a file from local server (maybe in the future i need to do that in other server). When i click on the link to download the file in the browser appear this message "about:blank#blocked".
I am using axios and vue.js
. The code is this:
downloadItem(urlDoc) {
console.log(urlDoc);
axios({
method: 'get',
url: urlDoc,
responseType: 'arraybuffer',
}).then(function(response) {
let blob = new Blob([response.data], { type: 'image/png' })
let link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = 'image.png'
link.click()
})
}
Previously i add a chrome extension to able the call request. The extension is allow-control-allow-origin.
Thanks.