What is the correct content-type to download automatically?

0

I have a download functionality on a button, clicking does not download the file, the contents of the worksheet are displayed inside the page. This only occurs on IOS devices. I've tried using other content-type for .xls or the force-download but the behavior is the same.

header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment;filename="planilha.xlsx"');
header('Cache-Control: max-age=1');

header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header ('Cache-Control: cache, must-revalidate');
header ('Pragma: public'); // HTTP/1.0

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save('php://output');
    
asked by anonymous 10.07.2018 / 23:50

0 answers