Welcome Guest, Not a member yet? Register   Sign In
Having issues setting Content-Type header. Still coming out as text/html
#5

[eluser]WanWizard[/eluser]
CI's output class only works on code that uses it. It doesn't include echo, fpassthru(), header() or other statements that generate output.

Code:
$img = fopen('../content/path-to-image.jpeg', 'r');
if ($img)
{
    // if you want to be absolutely sure, include this
    ob_end_clean();
    header('Content-Type: image/jpeg');
    fpassthru($img);
    exit;
}
works just fine here...


Messages In This Thread
Having issues setting Content-Type header. Still coming out as text/html - by El Forum - 10-20-2010, 12:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB