When I try to display PDF , not working when pdf contains path, just working if the file is in the same index
This Works <a href="myfile.pdf" target="_blank">View PDF</a>
The below not working .. ERROR The requested URL was not found on this server. <a href="admin/assets/cvs/myfile.pdf" target="_blank">View PDF</a>
I am sure that the path is right and I tested with .png extensions.
Also I tried to use header function to display PDF with PHP but got also error even if the file in the same directory index Failed to load PDF document.
$fileName = "myfile.pdf";
header('Content-type: application/pdf');
header('Content-Disposition: inline; filename="' .urlencode($fileName). '"');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($fileName));
header('Accept-Ranges: bytes');
@readfile($fileName);