S
SolidJS5mo ago
vveil

Download file from public/documents

Hi, I want to have an A-Element, that starts a download for a .pdf-file I placed in public/documents. Currently it looks something like this:
<A
href="documents/file.pdf"
download="file.pdf"
class="primary-button flex-1 text-center"
>
Download
</A>
<A
href="documents/file.pdf"
download="file.pdf"
class="primary-button flex-1 text-center"
>
Download
</A>
When clicking on this element a download with the correct filename starts, but I can't open the file because it seems to be corrupted or damaged. I tried this with different PDFs. Opening the in public/documents directly on my machine works without problems. Can anybody tell me where I went wrong?
0 Replies
No replies yetBe the first to reply to this messageJoin