Welcome Guest, Not a member yet? Register   Sign In
Headers for file download the CI way
#1

[eluser]mr_prasanna[/eluser]
Hi

I tried the set output header method to do the following but had no luck. Browsers displayed the binary stream instead of forcing to download. What's the most graceful way to achieve this in CI?

This snippet is part of 'download' function in a controller:
Code:
header('Content-Description: File Transfer');
                    header('Content-Type: application/octet-stream');
                    header('Content-Disposition: attachment; filename="'.$f_name.'"');
                    header('Content-Length: ' . filesize($f_full));
                    ob_clean();
                    flush();
                    readfile($f_full);
                    exit;


Messages In This Thread
Headers for file download the CI way - by El Forum - 01-24-2010, 07:59 AM
Headers for file download the CI way - by El Forum - 01-24-2010, 08:55 AM
Headers for file download the CI way - by El Forum - 01-24-2010, 08:38 PM
Headers for file download the CI way - by El Forum - 01-25-2010, 01:07 AM
Headers for file download the CI way - by El Forum - 01-25-2010, 02:25 AM
Headers for file download the CI way - by El Forum - 01-25-2010, 01:05 PM
Headers for file download the CI way - by El Forum - 01-25-2010, 01:23 PM
Headers for file download the CI way - by El Forum - 01-25-2010, 11:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB