Jump to content

export data to excel file (works on IE/Firefox but not google chrome)


new_php85

Recommended Posts

Basically, i using this code to generate excel file

 

if($_REQUEST["rFormat"]=="2")

{

          header("Content-Type:  application/x-msexcel");

          header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

          header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

}

 

and it works at IE and FF. Only google chrome not work.

Basically, i using this code to generate excel file

 

if($_REQUEST["rFormat"]=="2")

{

          header("Content-Type:  application/x-msexcel");

          header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

          header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

}

 

and it works at IE and FF. Only google chrome not work.

 

i got the problem

 

it suppose like this

 

if($_REQUEST["rFormat"]=="2")

{

      header("Content-Type:  application/x-msexcel");

      header("Expires: 0");

      header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

      header("Content-Disposition: attachment; filename=email_sms_export.xls");// i missed out this link

}

 

now its works on IE/FF/Google Chrome  :D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.