I have created a promise in Vue that returns some data that I am creating a Excel Spreadsheet with. I have the spreadsheet opening with the data populated, however it opens it in Protected View, is there any way to ensure I open it in normal view?
Here is the code
from my vuex store...
exportSearch: ({commit, state, rootGetters}) => {
return new Promise(resolve, reject) => {
Vue.http.post(`URI PLACEHOLDER`, {responseType: "blob")
.then((response) => {
resolve(response);
})
.catch(() => {
reject();
})
})
})
Then in my export button
methods:{
saveFile: function(){
this.$store.dispatch('search/exportSearch')
.then((response) => {
let filename = (response.headers.get('Content-Disposition') || '').split('filename=')[1];
if(filename !=== ''){
filename = filename.replace(/['"]/g, '')
}
let link = document.createElement('a');
link.href = window.URL.createObjectURL(response.data);
link.download = filename
document.body.appendChild(link)
link.click();
document.body.removeChild(link)
}