Use real file names when download files from tables

This commit is contained in:
Andrew Kingston 2022-08-15 11:37:40 +01:00
parent 05bfd86b91
commit 35528ee17e
1 changed files with 12 additions and 2 deletions

View File

@ -15,14 +15,24 @@
{#each attachments as attachment}
{#if isImage(attachment.extension)}
<Link quiet target="_blank" href={attachment.url}>
<Link
quiet
target="_blank"
download={attachment.name}
href={attachment.url}
>
<div class="center" title={attachment.name}>
<img src={attachment.url} alt={attachment.extension} />
</div>
</Link>
{:else}
<div class="file" title={attachment.name}>
<Link quiet target="_blank" href={attachment.url}>
<Link
quiet
target="_blank"
download={attachment.name}
href={attachment.url}
>
{attachment.extension}
</Link>
</div>