Welcome Guest, Not a member yet? Register   Sign In
force_download + Chrome = Broken
#1

[eluser]Lowkase[/eluser]
The force_download function in the download helper is no longer working with Chrome (3.0.195.27).

A download dialog box is never displayed. The logic flow simply flows past the force_download call with no download action ever firing.

I have tested in Firefox, Opera, Safari IE and IE6 and it works. In Chrome it does not.

I can repeat this behavior 100% of the time on Chrome at the moment ;(.


Cheers,

Lowkase
#2

[eluser]Tom Schlick[/eluser]
can we see the code? it would be very helpful to diagnose the problem.
#3

[eluser]Lowkase[/eluser]
Code:
function download($file_name)
        {
            // Declarations
            $result = FALSE;

            if( isset( $file_name ) )
            {
                if( file_exists( PUBPATH . '/uploads/' . $file_name ) )
                {
                    $data = file_get_contents(PUBPATH . '/uploads/' . $file_name);
                    force_download($file_name, $data);
                    $result = TRUE;
                }
            }

            return $result;
        }


Quote:A download dialog box is never displayed. The logic flow simply flows past the force_download call with no download action ever firing.

I should be more specific, I can debug into the download_helper.php file and everything seems to fire as it should. I am thinking that the header entries at the end of the download_helper.php aren't having any affect on Chrome.

Hope this helps.


Cheers,

Lowkase
#4

[eluser]Pascal Kriete[/eluser]
Quote:The logic flow simply flows past the force_download call with no download action ever firing.

So if you output something after the force_download call it shows up? It should never get past that call. What version of CI are you on?
#5

[eluser]Lowkase[/eluser]
I am using the latest and greatest version of Codeigniter.

I tried using this upgrade to force_download yesterday:

http://ellislab.com/forums/viewthread/71192/P10/

Initially it didn't work, but this morning its working which leads me to believe that I could of had a caching issue? It's bewildering to say the least.


Cheers,

Lowkase




Theme © iAndrew 2016 - Forum software by © MyBB