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

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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"');

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.