1

I am trying to parse an XLSX file with PhpExcel on Google App Engine. When I run the script it gives me this error: Invalid or uninitialized Zip object. I've read other questions but they don't seem to help ( PHPExcel Google App Engine not saving file for Excel2007 ),( Using phpExcel to download xlsx file using Google App Engine ), ( Google App Engine trowing error for PHPExcel ). I have tried to write the file to the temporary folder (sys_get_temp_dir()) but it gives me the same error when i read from there.

        $inputFileName = $this->Anexos_model->get_path($id_anexo);

    $temp = tempnam(sys_get_temp_dir(), 'TMP_');
    file_put_contents($temp, file_get_contents($inputFileName));

    var_dump($temp);

    $objReader = PHPExcel_IOFactory::createReader($inputFileType);
    $objReader->setReadDataOnly(true);
    $objPHPExcel = $objReader->load($temp);

It gives me this:

A PHP Error was encountered

Severity: Warning

Message: ZipArchive::getFromName(): Invalid or uninitialized Zip object

Filename: Reader/Excel2007.php

Community
  • 1
  • 1
Ren
  • 431
  • 6
  • 15
  • please share a minimal example of the code you're using. That way, the users of Stack overflow can help out... – Jaap Nov 02 '15 at 14:09
  • I pasted an example to illustrate what I'm trying to do. – Ren Nov 02 '15 at 14:10

1 Answers1

1

Have you checked if zlib is active on your php environment ? Check also your memory_limit if the XLSX is too big.

René
  • 51
  • 5
  • Yes, it is active by default on Google App Engine Environment. – Ren Nov 02 '15 at 15:07
  • I think the memory limit is ignored by app engine. It uses my instance memory to process data. Thanks anyway. – Ren Nov 02 '15 at 15:23