Download a file in html form

Hi at all,
I want to download a pdf file in my html form. The pdf file is stored in my resources/static/forms folder, directly where my html form is.
This is what my code looks like:

    <a href="/workflow/src/main/resources/static/forms/instructions.pdf" download>Download</a>

I even tried different hrefs, for example: “/resources/static/forms/instructions.pdf”, “/instructions.pdf” and “/static/forms/instructions.pdf”. But nothings works. I just get this error:
image

Does anybody have an idea on this? I guess I am missing something simple, because usually this is no big thing downloading a pdf :stuck_out_tongue:

Thank you for your help.

Anything in static should be relative to the root. I would expect the following to do the trick:

 <a href="/forms/instructions.pdf" download>Download</a>

If it doesn’t, knowing a bit more about your development/deployment environment might be helpful.

1 Like

Hey,
Thank you for the reply. Sorry I forgot to mention that I am having a java springboot application.
However I managed to solve it.
I found out, that my file is available under http://localhost:8080/instructions.pdf and that the false link is pointing to http://localhost:8080/camunda/app/tasklist/default/instructions.pdf.
So I changed my code to the following, to point to the right location:

<a href="../../../instructions.pdf" download>Download</a>

I hope this helps anybody too :slight_smile: