Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

SvelteKit - How to download a file from the assets?

$
0
0

I'm using SvelteKit and I have a file src/assets/my-file.pdf. I'm trying to make a button to download it:

<a download="my-file.pdf" target="_blank" href="assets/my-file.pdf">    Download</a>

But when I click on it, it doesn't work, I get the error File wasn't available on site.

How to download a file from the assets folder?


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>