mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-16 05:13:06 +00:00
fix: download drive files via temporary link (#5644)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
parent
2c89008374
commit
fe2756aabf
@ -50,8 +50,13 @@ async function EditDrive (drive: Drive): Promise<void> {
|
|||||||
async function DownloadFile (doc: File | File[]): Promise<void> {
|
async function DownloadFile (doc: File | File[]): Promise<void> {
|
||||||
const files = Array.isArray(doc) ? doc : [doc]
|
const files = Array.isArray(doc) ? doc : [doc]
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const url = getFileUrl(file.file, 'full', file.name)
|
const href = getFileUrl(file.file, 'full', file.name)
|
||||||
window.open(url, '_blank')
|
const link = document.createElement('a')
|
||||||
|
link.style.display = 'none'
|
||||||
|
link.target = '_blank'
|
||||||
|
link.href = href
|
||||||
|
link.download = file.name
|
||||||
|
link.click()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user