|
|
@ -1,6 +1,7 @@ |
|
|
|
import type { AttachmentReqType, AttachmentType } from 'nocodb-sdk' |
|
|
|
import type { AttachmentReqType, AttachmentType } from 'nocodb-sdk' |
|
|
|
import { populateUniqueFileName } from 'nocodb-sdk' |
|
|
|
import { populateUniqueFileName } from 'nocodb-sdk' |
|
|
|
import DOMPurify from 'isomorphic-dompurify' |
|
|
|
import DOMPurify from 'isomorphic-dompurify' |
|
|
|
|
|
|
|
import { saveAs } from 'file-saver' |
|
|
|
import RenameFile from './RenameFile.vue' |
|
|
|
import RenameFile from './RenameFile.vue' |
|
|
|
import { |
|
|
|
import { |
|
|
|
ColumnInj, |
|
|
|
ColumnInj, |
|
|
@ -317,7 +318,7 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState( |
|
|
|
async function downloadFile(item: AttachmentType) { |
|
|
|
async function downloadFile(item: AttachmentType) { |
|
|
|
const src = await getAttachmentSrc(item) |
|
|
|
const src = await getAttachmentSrc(item) |
|
|
|
if (src) { |
|
|
|
if (src) { |
|
|
|
;(await import('file-saver')).saveAs(src, item.title) |
|
|
|
saveAs(src, item.title) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
message.error('Failed to download file') |
|
|
|
message.error('Failed to download file') |
|
|
|
} |
|
|
|
} |
|
|
|