Php 为什么Excel文件格式不正确?
文件: 为什么我不能正常打开 打开文件时,我看到一堆模糊的字符,即使编码是正常的 我使用laravel 5和laravel excel。 laravel excel: 查看“admin.excel.users”: 请求标头:Php 为什么Excel文件格式不正确?,php,html,excel,http,laravel,Php,Html,Excel,Http,Laravel,文件: 为什么我不能正常打开 打开文件时,我看到一堆模糊的字符,即使编码是正常的 我使用laravel 5和laravel excel。 laravel excel: 查看“admin.excel.users”: 请求标头: Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Encoding:gzip, deflate, sdch Accept-Language:ru-
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4
Connection:keep-alive
Host:depozit.cash
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36
帮助我。确保除Excel数据外,没有任何内容发送到您的浏览器;并确保您的标题适用于Excel文件,而不是html,因为只有文件格式也是错误的。我写了标题。请帮助,我按照说明做了所有事情。在向浏览器发送数据时,重要的是响应标题,而不是请求标题
<html>
<table>
<tbody>
<tr>
<td width="100">
№ {{ $num }}</td>
<td width="100">
Имя: {{ $info->data_name }}</td>
<td width="100">
id: {{ $info->id }}</td>
<td width="100">
Расч. счет: {{ $info->checkingAccount }}</td>
<td width="100">
Сумма депоз: {{ $info->data_depositsSum }}</td>
<td width="100">
Город: {{ $info->city }}</td>
<td width="100">
Область: {{ $info->area['NAZVA'] }}</td>
<td width="100">
Структ: {{ $info->data_treeCount }}</td>
</tr>
</tbody>
</table>
</html>
Cache-Control:cache, must-revalidate
Connection:Keep-Alive
Content-Disposition:attachment; filename="users.xls"
Content-Encoding:gzip
Content-Length:1014
Content-Type:application/vnd.ms-excel; charset=UTF-8
Date:Tue, 06 Oct 2015 12:21:00 GMT
Expires:Mon, 26 Jul 1997 05:00:00 GMT
Keep-Alive:timeout=1, max=100
Last-Modified:Thu, 01 Jan 1970 00:00:00 GMT
Pragma:public
Server:Apache/2
Vary:Accept-Encoding,User-Agent
X-Powered-By:PHP/5.6.13
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4
Connection:keep-alive
Host:depozit.cash
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36