Topics: Developer Forum
Aug 5, 2010 at 4:22 PM
I'm having an issue with the PHPExcel save function. Any help would be appreciated. It seems when the code runs, I see the browser looks like it is performing a task, but then nothing happens. I'm not sure if files are saving somewhere on the server, but what I need is for it to prompt a save message. The portion below is where the problem is occurring. The best description I can give is the browser has a busy message when I push the button to run this program and then nothing happens. I'm not sure if the file is saving or not. //code used to set title of sheet $objPHPExcel->getActiveSheet()->setTitle($strFileName); /** PHPExcel_IOFactory */ require_once '../lib/PHPExcel1.7/Classes/PHPExcel/IOFactory.php'; $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter->save($strFileName); $strFileData = file_get_contents($strFileName); unlink($strFileName); header("Content-Type: application/force-download\n"); //set the value of the fields in Opened dailog box header('Content-Disposition: attachment; filename=' . $strFileName); $strFileData=fnGenerateExcelFile($rowset,$display_columns,$strFileName); header('Content-Length: '.strlen($strFileData)); echo $strFileData;