getTemporaryFilename(); $writer = new Xlsx($sampleSpreadsheet); $writer->save($filename); $callStartTime = microtime(true); $spreadsheet = IOFactory::load($filename); $helper->logRead('Xlsx', $filename, $callStartTime); // Save $helper->write($spreadsheet, __FILE__); unlink($filename);