Open a existent pdf file using CI

#11
[eluser]Adi Setiawan[/eluser]
any error message ? try to open http://yourdomain.cnom/path/to/file.pdf in your browser

#12
[eluser]Thiago Luiz[/eluser]
I'm using the Vertrigo, doing what you said http://yourdomain.cnom/path/to/file.pdf in my browser, the request goes to the index.php of Vertrigo Serv.

#13
[eluser]Thiago Luiz[/eluser]
no message errors, just browser not found the page requested

#14
[eluser]Thiago Luiz[/eluser]
Solved the problem. I put the subfolder where the pdf file on the same level of the CI system folder and again tried to use that Adi Setiawan said:

$ this-> load-> helper ( 'download');
$ data = file_get_contents ( "subfolder / file.pdf");
$ name = 'file.pdf';
force_download ($ name, $ date);

And it worked, now I can load through a view open a pdf file.

#15
[eluser]Thiago Luiz[/eluser]
Thanks Adi, hostcord and jalalski.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.