Answer the question
In order to leave comments, you need to log in
How to solve error after file creation via phpspreadsheet?
Has anyone encountered such an error? I create a file according to a template (according to this documentation phpspreadsheet.readthedocs.io/en/develop/topics/re...
$reader = IOFactory::createReaderForFile($file);
$spreadsheet = $reader->load($file);
$cells = $spreadsheet->getActiveSheet()->getCellCollection();
foreach ($positions as $position) {
$cells->get('A' . $position['id'])->setValue($position['sum']);
}
$writer = IOFactory::createWriter($spreadsheet, ucfirst(pathinfo($file, PATHINFO_EXTENSION)));
$fileName = time() . '.' . pathinfo($file, PATHINFO_EXTENSION);
$writer->save("./$fileName");
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>Поместить результат восстановления в zavyalov_10_15333315530.xml</logFileName><summary>Обнаружены ошибки в файле \"/Users/paul/Downloads/zavyalov_10_1533331553.xlsx\"</summary><removedParts summary="Ниже приведен список удаленных компонентов:"><removedPart>Удаленный компонент: Рисованная фигура.</removedPart></removedParts></recoveryLog>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question