php - how to open file pdf in codeigniter


i have a problem, i can open and view pdf file in localhost, but when i upload to hosting it become blank and not display anything. when i try to access direcly in url it become blank when i try to download with IDM, it success full downloaded

this is the file

this is my view

<a href="<?=base_url('uploads/syarat/'.$username.'/'.$namafile)?>" target="_blank">Show My Pdf</a>



i turn off IDM and i can open with default embed / use google doc viewer

 <div >
<div >
  <a href="<?php echo base_url();?>/uploads/syarat/<?php echo $username.'/'.$namafile;?>" role="button"><i ></i> Buka Di Tab Baru</a>
<object id="pdf" data="<?php echo base_url();?>uploads/syarat/<?php echo $username.'/'.$namafile;?>" type="application/pdf" width="100%" height="600px" />

People are also looking for solutions to the problem: Why Laravel shows an error 'This page is'nt working', when access application without php artisan serve?


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.