[eluser]louis w[/eluser]
I am trying to use readfile (or CI read_file) to load an image from the server and output it to the browser. What is really strange is that if I watch my logs I see two requests happening right after each other every time it runs.
This is what I am running:
// Shows the image, but two requests show up in system logs
header('Content-type: '.$file['mime']);
readfile($load_path);
// Outputs binary data to browser
$this->output->set_header('Content-type: '.$file['mime']);
readfile($load_path);
// Doesn't work
$this->output->set_header('Content-type: '.$file['mime']);
return read_file($load_path);
Any idea what might be going on?