G
G
gutsout2015-05-27 15:30:15
PHP
gutsout, 2015-05-27 15:30:15

Generating xls from html, warning "File format does not match file permission"?

Hello, the generated xls file opens in MS Excel 2013 with the warning "The file format does not match the file permission...", as if you click "Yes" and everything opens fine, but I would like it without any warnings.
Code snippet:

header("Content-Type: application/vnd.ms-excel; charset=windows-1251");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header('Content-Disposition: attachment; filename=filename.xls);

echo<<<HTML
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
</head>
<body>
<table border="1" cellspacing="0" cellpadding="0">
/* вагон строк */
</table>
</body>
</html>
HTML
die();

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2015-05-27
@gutsout

If you want without warnings - generate a real valid xls-file.
In your case, all of a sudden , the file permission doesn't really match the content.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question