Tuesday, April 24, 2012

How do I get php to open a pdf file in a new tab?

I don't understand the documentation I've been reading. Can anyone here explain how to do this?



I have a HTML link that goes to a function showFile(). There are two gets, an id, which is the file name, and an ext, the extension of the file.(Only extensions will be pdf, jpg, and gif) I'm using codeigniter framwework btw.



I read stuff about headers but when i tried that it just downloaded the file. Any help would be appreciated.



Function so far ---------



 public function showFile () {
$fileId = $this->input->get('id');
$fileExt = $this->input->get('ext');

}




No comments:

Post a Comment