开发者

CSV file not open in IE

I have create a CSV file in my php code, after create CSV, I try to open the CSV using window.open(), this will work fine all browser except IE 7 and IE 8,

in IE a new win开发者_Python百科dow open then it close automatically

how to solve this problem,


If I recall, Internet Explorer has a peculiar quirk when trying to open files, even if the proper MIME type is set in the header.

You may need to do the following to get the CSV to download:

  • Go to Tools > Internet Options
  • Select the Security tab, then press the Custom Level... button
  • Scroll down to the Downloads section, and under Automatic prompting for file downloads select Enable

Hopefully, that should resolve the issue.


Try adding the following at the beginning of your script:

header('Content-Disposition:inline');

This should direct the browser to display the file instead of prompting a download, which may be the problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜