[eluser]sheldonnbbaker[/eluser]
Hi everyone,
New to CI but I've been making a simple asset controller to serve up css, javascript, and images to give me a little more control of what I serve out in terms of requests.
Anyways, this is what I have for outputting PNGs:
Code:
$this->output->set_header("Content-type: text/png");
$this->load->file('system/application/views/assets/img/' . $this->uri->rsegment(3) . '.png');
($this->uri->rsegment(3) is the name of the file).
Problem is this: I'm getting PHP errors, like this one:
Quote:[23-Jan-2009 14:46:10] PHP Parse error: syntax error, unexpected T_STRING in ...../system/application/views/assets/img/body-background.png on line 4
Is there a way to just have it return the file's contents, and not read it like a PHP file? Something equivalent to fread() or file_get_contents()?
Thanks