简体   繁体   English

如何在codeigniter中打开pdf文件

[英]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.我有一个问题,我可以在本地主机中打开和查看 pdf 文件,但是当我上传到托管时它变成空白并且不显示任何内容。 when i try to access direcly in url it become blank when i try to download with IDM, it success full downloaded当我尝试在 url 中直接访问时,当我尝试使用 IDM 下载时,它变为空白,成功完全下载

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我关闭 IDM,我可以使用默认嵌入打开/使用谷歌文档查看器

 <div class="col-xs-12">
<div class="row">
    <a href="https://docs.google.com/viewerng/viewer?url=<?php echo base_url();?>/uploads/syarat/<?php echo $username.'/'.$namafile;?>" class="btn btn-sm btn-primary" role="button"><i class="ace-icon  glyphicon glyphicon-plus"></i> Buka Di Tab Baru</a>
</div><br/>
<object id="pdf" data="<?php echo base_url();?>uploads/syarat/<?php echo $username.'/'.$namafile;?>" type="application/pdf" width="100%" height="600px" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM