0

when i try to create a Excel2007 file in App Engine Development i am getting error message like below

Fatal error: Uncaught exception 'PHPExcel_Writer_Exception' with message 'Could not close zip file vfs://root/temp//phpxltmp55e656770cf804.01144164.' in C:\inetpub\wwwroot\GAE\teja-school\Excell\Classes\PHPExcel\Writer\Excel2007.php:399 Stack trace: #0 C:\inetpub\wwwroot\GAE\teja-school\index.php(31): PHPExcel_Writer_Excel2007->save('php://output') #1 C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\php\setup.php(147): require('C:\inetpub\wwwr...') #2 {main} thrown in C:\inetpub\wwwroot\GAE\teja-school\Excell\Classes\PHPExcel\Writer\Excel2007.php on line 399

my code is

$objPHPExcel = new PHPExcel();

PHPExcel_Shared_Font::AUTOSIZE_METHOD_EXACT;
$objPHPExcel->setActiveSheetIndex(0);
$excell= $objPHPExcel->getActiveSheet();



$excell->setCellValue('A1', 4);




header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="my_file.xlsx"');
header('Cache-Control: max-age=0');

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save('php://output');
exit;

after i deployed it to Appengine production server it is showing that 'web page is not available'

any possible way to achieve it.

pnuts
  • 58,317
  • 11
  • 87
  • 139
Kishore Reddy
  • 147
  • 10
  • you aware that appengine does not have write access to the filesystem? – Zig Mandel Sep 02 '15 at 03:22
  • ok. But if i changed from Excel2007 to Excel5 and file extension from 'xlsx' to 'xls', It is working perfectly (even on production server too). Why not for Excel2007? – Kishore Reddy Sep 02 '15 at 04:08
  • your q is missing key info. 1: what you just said. 2: does it work on regular non-appengine php? edit the question – Zig Mandel Sep 02 '15 at 04:20
  • on non-appengine php I am able run the code perfectly and iam getting downloadable file. But when it comes to appengine php two things are happening 1) If i set PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); I am able to download the file with out any error. 2) if i set PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); it is not sending file to browser instead it is showing as 'web page not found' – Kishore Reddy Sep 02 '15 at 04:50

0 Answers0