Skip to content

Excel sheet not displaying after saving from Datatable #2526

Answered by MarkBaker
Jay-Bruh asked this question in Q&A
Discussion options

You must be logged in to vote

You can't control where the file will be saved in the client users machine; but you do need to send it to php://output using

$writer->save('php://output');

However, that alone simply tells it to send the file data to he user's browser, which results in the

PKÖ99TGD²Zð[Content_Types].xml­ËNÃ0E÷|Eä-J²@5íÂQ>°'UǶl÷õ÷LÔ@nbEñ½gr=ãñtWëd>(k 6Êr V*³,ØÛâ)½cI$hk°`{l:¹/öCBb VÅèî9¢ÂBfúRZ_C¤W¿äÄ Èoòük"ÆÆMÆ/Ä÷Jb2¡&ßiÉ »ç(#?X?cÿôÿkÔð(_£§æ¸øÄ}

that you see... that's the stream of excel file data

You also need to tell the browser that what you're sending is a stream of Excel file data rather than a stream of html data, by sending the appropriate headings to their bowser before yo send the filestream.

// …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by oleibman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants