【发布时间】:2013-05-30 12:22:40
【问题描述】:
我正在尝试在我的 Tidesdk 应用程序中生成强制下载 excel 文件。所以我正在尝试以下代码工作,但它无法正常工作。所以请大家帮我找出解决方案。
<?php
header ("Content-type: application/octet-stream");
header( "Content-disposition: attachment; filename=sheet.xls" );
echo 'First Name' . "\t" . 'Last Name' . "\t" . 'Phone' . "\n";
echo 'Maddy' . "\t" . 'Shan' . "\t" . '555-4445' . "\n";
?>
【问题讨论】:
-
如果您不设置标头,应用程序的行为如何?那么这些行会显示出来吗?
标签: php header tidesdk force-download