I have a website hosted on Netlify. it is a simple HTML CSS and JS web page.
in. this page I want users to be able to download two PDF files.
the files are stored in a folder called ‘forms’ in the root folder of the app.
when I deploy my website and try to download the files it looks like it doesn’t find the files, I get an empty file download.
checked the files path and names few times but all looks good and in development it is working.
Are you able to share the URL for page where these downloads are listed?
If deploying via git, can you share the repository you are deploying the site from?
this is the web page:
to get to the file link: on navbar theres one dropdown, the sub links are items to download.
the pdf’s are in ‘/forms’
@OrGranot You’re using Vite, and it doesn’t work the way that you think it does.
While you’ve used only simple HTML, CSS & JS, Vite is running a build process etc.
You should read their Static Asset Handling documentation.
Specifically the section on the public directory.
You’ll also find that you aren’t deploying the root of your repository, but rather the
dist folder that Vite produces, which is why your files in the root aren’t deployed.
If you move the files into the
public directory, they’ll be copied into the
dist folder during build, and thus get deployed.