[Vuejs]-Asp.net Core Web API – Downloading multiple images from blob storage to zip file (via Axios get)

0πŸ‘

It was just a case of updating my axios call to include the response type:

        GetAllAssetResources ({commit},assetDetailid)
    {
        console.log("Getting Asset Resources:" + id);
        return new Promise((resolve) => {
            axios({
                url: CONFIG.platformEndPoints+  '/asset/downloadResources/' + id,
                method: 'GET',
                responseType: 'blob'})
            .then( (response) => {
                const url = window.URL.createObjectURL(new Blob([response.data]));
                const link = document.createElement('a');
                link.href = url;
                link.setAttribute('download', 'resources.zip');
                document.body.appendChild(link);
                link.click();
            })
        })
    },

Leave a comment