How to open a pdf located in a root folder in codeigniter without downloading the file?
<p>I am a newbie in codeigniter. I am working on a site that can upload and view a PDF file. I've already succeeded on the upload.</p>

<p>The problem is, whenever I want to view the uploaded file in the browser, it is automatically downloading. I want to view the PDF file in the browser. how can i do it?</p>

<p>here is the code in my <strong>VIEW</strong></p>

<pre><code>&lt;?php
            echo '&lt;table class  = "table table-striped"&gt;';
            echo '&lt;tr&gt;';
            echo '&lt;th class="table_head"&gt;Filename&lt;/th&gt;';
            echo '&lt;th class="table_head"&gt;Department&lt;/th&gt;';
            echo '&lt;th class="table_head"&gt;Uploaded by&lt;/th&gt;';
            echo '&lt;th class="table_head"&gt;&lt;/th&gt;';
            echo '&lt;/tr&gt;';

        if(isset($tbl_uploaded) &amp;&amp; is_array($tbl_uploaded) &amp;&amp; count($tbl_uploaded) &gt; 0)
        {
            foreach($tbl_uploaded as $uploaded)
            {
                echo '&lt;tr&gt;';
                echo '&lt;td&gt;'. $uploaded-&gt;name .'&lt;/td&gt;';
                echo '&lt;td&gt;'. $uploaded-&gt;department .'&lt;/td&gt;';
                echo '&lt;td&gt;'. $uploaded-&gt;uploader .'&lt;/td&gt;';
                echo '&lt;td&gt;&lt;a href="'. base_url().'uploads/'.$uploaded-&gt;name .'" target="_new"&gt;View&lt;/a&gt;&lt;/td&gt;';
                echo '&lt;/tr&gt;';
            }
        }
        echo '&lt;/table&gt;';
    ?&gt;
</code></pre>

<p>thanks in advance guys</p>