Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- downloadFile () {
- axios.get(`https://localhost/storage/${this.file.name}`, {responseType: 'blob'})
- .then((response) => {
- const url = window.URL.createObjectURL(new Blob([response.data]));
- const link = document.createElement('a');
- link.href = url;
- link.setAttribute('download', this.file.name);
- document.body.appendChild(link);
- link.click();
- })
- .catch((error) => {
- this.dropdownMenuShown = false
- this.showNotification({type: error.response.data.status, message: error.response.data.message})
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement