I am trying to get a pdf file from the server using php. The file is pdf and it is not corrupt, but when I use this code adobe says its a corrupt file.
I just want to show a file to users like a regular link
<a href="123.pdf"> this file </a>
but i am using php because it is going to an htaccess locked directory so I am having php get it.
Is there any other way to do it?
<?php
header("Content-Type: application/pdf");
header("Content-Transfer-Encoding: binary ");
header("Content-Disposition: attachment; filename=123.pdf");
readfile("/home/xx/public_html/downloads-locked/");
?>