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