filename of downloaded image changed

This commit is contained in:
Moriz Wahl 2020-10-14 12:19:53 +02:00
parent 6ff02b41c8
commit 3ba72526b9
2 changed files with 3 additions and 2 deletions

View File

@ -42,6 +42,7 @@ script:
- docker-compose exec webapp yarn run lint
- docker-compose exec webapp yarn run test --ci --verbose=false --coverage
# Fullstack
# disable for last deploy, because of flakiness!
# - docker-compose down
# - docker-compose -f docker-compose.yml up -d
# - wait-on http://localhost:7474

View File

@ -50,10 +50,10 @@ export default {
},
downloadImage({ url }) {
this.$axios.get(url, { responseType: 'blob' }).then((response) => {
const blob = new Blob([response.data], { type: 'application/pdf' })
const blob = new Blob([response.data])
const link = document.createElement('a')
link.href = URL.createObjectURL(blob)
link.download = url
link.download = url.replace(/^.+\//g, '')
link.click()
URL.revokeObjectURL(link.href)
})