Open PDF file from web browser with php
<p>I need to open pdf document. So far I have web application which has pdf file path in hyperlink so when I click on that link it has to open that file in web browser or default pdf application like Acrobat. Here is link<br> <code>&lt;div class="col-md-7 value"&gt;&lt;a href="c:/JobData/4861.pdf" class="btn btn-default btn-sm"&gt; View &lt;/a&gt; &lt;/dv&gt;</code><br> When I tried to open it firefox says "The address wasn’t understood". Same file I can open in firefox by right click on file and selecting "open with" option. 
I also tried to open it with php code but there is message that "PDF document might not displayed correctly" and it didn't show content at all. Here is php code <br></p>

<pre><code>&lt;?php
$file = 'c:/JobData/';
$filename = '4861.pdf'; 
header('Content-type: application/pdf');
header('Content-Disposition: inline; filename="' . $filename . '"');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($file));
header('Accept-Ranges: bytes');

@readfile($file);
?&gt;
</code></pre>

<p>Does someone has solution for this? Thanks for viewing this question.</p>