Reputation: 1827
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 window open then it close automatically
how to solve this problem,
Upvotes: 1
Views: 934
Reputation: 28753
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.
Upvotes: 1
Reputation: 15370
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:
Tools
> Internet Options
Security
tab, then press the Custom Level...
buttonDownloads
section, and under Automatic prompting for file downloads
select Enable
Hopefully, that should resolve the issue.
Upvotes: 1