Solution 1 :

When you work with a server (local server too) the root of the urls/links must be the server, not your computer.

For example, in your case, if the root folder of your server is ‘SMIS’ the correct URL will be “http://localhost/SMIS/Files/6.pdf

Problem :

I try to put a link to a file in my page, such that, once a user clicks the link – the browser downloads the file.


<a href="correct_path...." download>downloadable link</a>

Here is the image shows the full path of the link:

enter image description here

And here is the image shows the file does exist:

enter image description here

So why, when I click the link NOTHING happens? it doesn’t download..


Comment posted by Nabeel Khan

what is the exact path / code that you are using? please share that

Comment posted by Qwert Trewq

@NabeelKhan it contains

Comment posted by Nabeel Khan

can you share an example html output that you see?

Comment posted by Quentin

Open the developer tools. Look at the console. It probably says something like

Comment posted by Nabeel Khan

You need to output the link relative to the http:// url of the current page, not the php directory. Find the http path of the folder and use it instead. So you should instead use: