mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 11:50:56 +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> {
|
||||
const files = Array.isArray(doc) ? doc : [doc]
|
||||
for (const file of files) {
|
||||
const url = getFileUrl(file.file, 'full', file.name)
|
||||
window.open(url, '_blank')
|
||||
const href = getFileUrl(file.file, 'full', file.name)
|
||||
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