Skip to content
Advertisement

Generating and downloading an excel file generates a ERR_INVALID_RESPONSE

This is my code:

JavaScript

From my local server operating on lamp when I call this function I can get the excel sheet and the web page would close after I call the function, when I’m calling it however on my apache server it brings out the error: ERR_INVALID_RESPONSE, I went through the code putting a die(); after each line to see how it would respond and up until putting a die() after $objWriter=PHPExcel_IOFactory::createWriter($objPHPExcel,'Excel2007'); it would download the spreadsheet but it would be corrupted and wouldn’t close the page and it wouldn’t bring up that error message, however apparently $objWriter->save('php://output'); is causing the error to come up, the page would freeze and the excel file wouldn’t get downloaded.

I debugging someone else’s code but I can’t figure this part out.

Advertisement

Answer

Eventually the issue was in the ZipArchive class, that’s why it worked on one server and didn’t work on the other.

More documentation here: http://www.php.net/manual/en/zip.installation.php

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement