CodeIgniter Forums
Open a existent pdf file using CI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Open a existent pdf file using CI (/showthread.php?tid=15677)

Pages: 1 2


Open a existent pdf file using CI - El Forum - 02-12-2009

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


Open a existent pdf file using CI - El Forum - 02-12-2009

[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.


Open a existent pdf file using CI - El Forum - 02-12-2009

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


Open a existent pdf file using CI - El Forum - 02-12-2009

[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.


Open a existent pdf file using CI - El Forum - 02-12-2009

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