Jump to content

Internet Explorer cannot read Header Information


probypro7

Recommended Posts

Hi All...

 

I have problem about header. My code is about export mySql data to Excel

 

header("Content-Type: application/vnd.ms-excel; name='excel'");

header("Content-disposition:  attachment; filename=".date("YmdHis").".xls");

 

In FireFox everithing is OK but in IE cannot.

 

I have try it at my local server with IE is OK but in real server (online) this code not work properly.

 

Somebody know the problem? please help me!

 

Thanks,

Best regards,

Gede

 

 

Try using the Live HTTP Headers firefox extension to capture the headers for both your local and online server, and look for differences.  If possible, use something similar for IE.  Sometimes an apache setting (such as mod_gzip) will cause different headers to come out.

 

Quoting the filename may help too.. who knows?  Headers are always messy to deal with.

For backwards compatibility with all browsers, the filename attribute of the Content-disposition header should be contained in double quotes.

 

header("Content-Type: application/vnd.ms-excel;");

header('Content-disposition:  attachment; filename="'.date("YmdHis").'.xls"');

Try using the Live HTTP Headers firefox extension to capture the headers for both your local and online server, and look for differences.  If possible, use something similar for IE.  Sometimes an apache setting (such as mod_gzip) will cause different headers to come out.

 

Quoting the filename may help too.. who knows?  Headers are always messy to deal with.

 

Can you help me to explain Live HTTP Headers? I am newbie for this. Thanks a lot

For backwards compatibility with all browsers, the filename attribute of the Content-disposition header should be contained in double quotes.

 

header("Content-Type: application/vnd.ms-excel;");

header('Content-disposition:  attachment; filename="'.date("YmdHis").'.xls"');

 

Thanks Glyde, I already try it but Not Solve yet.

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.