1
In the view I created this link:
<td>
<?php
echo anchor("./anexos/cartao-confirmacao.pdf",
"<i class='glyphicon glyphicon-arrow-down'></i>",
['class' => 'btn btn-primary btn-block', 'name' => 'baixar']);
?>
</td>
From inside that folder anexos
there is the file .pdf
, but when I click on the link, it goes to a page that says the following error:
404 Page Not Found The page you requested was not found.
link that to Function anchor
calf: http://localhost/fideliza/anexos/cartao-confirmacao.pdf
i do not want it to go to a page and yes download the file that is in the folder anexos
yes... now it is downloading with this tag, but it fails to download, as if the file did not exist, but it exists..
– HawkB
That’s what I said, your link is not pointing to the file correctly. The link is broken. Which is the path where the images are ?
– Leandro Lima
http://localhost/fideliza/attachments/card-confirmation.pdf... the folder calls attachments and is not an image is a pdf file
– HawkB
On the link, instead of shortening the path, put the literal path and see if it works, put there
href="localhost/fideliza/anexos/cartao-confirmacao.pdf"
– Leandro Lima
doesn’t work yet... tried this:
base_url("anexos/cartao-confirmacao.pdf")
and it wasn’t either– HawkB
Inspect the link you created and look where the
href=
There’s some mistake there.– Leandro Lima
I inspected:
<a href="http://localhost/fideliza/anexos/cartao-confirmacao.pdf" class="btn btn-primary btn-block" name="download" download="download"><i class="glyphicon glyphicon-arrow-down"></i></a>
... is right the way... inside the project folderfideliza
has a folder calledanexos
.. is correct.. and the file is there– HawkB