简体   繁体   中英

Download with smartphone generate xls file with PHPExcel

I have a big problem when I want to download on my smart phone a xls file generated by PHPExcel it me download a php file named my page, while on my pc it load properly.

 header('Content-type: application/vnd.ms-excel'); header('Content-Disposition:inline;filename=fichie.xls'); $writer->save('php://output'); exit(); 

There's two problems with your line that sets the content disposition.

  1. It should have spaces between the words, which is a standard requirement for headers.

  2. It should be attachment if you want the file to download, as opposed to display inline.

eg

header('Content-Disposition: attachment; filename=fichie.xls');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM