diff --git a/plugins/drive-resources/src/index.ts b/plugins/drive-resources/src/index.ts index d2a67a555c..4777749dbf 100644 --- a/plugins/drive-resources/src/index.ts +++ b/plugins/drive-resources/src/index.ts @@ -50,8 +50,13 @@ async function EditDrive (drive: Drive): Promise { async function DownloadFile (doc: File | File[]): Promise { 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() } }