<?php
require __DIR__ . '/vendor/autoload.php';
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
$spreadsheet = $reader->load($origin_file);
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Xlsx($spreadsheet);
$writer->setPreCalculateFormulas(false);
$writer->setOffice2003Compatibility(true);
$new_file = './file_uploads/report_file/' . $file_info_idx.'_tmp.'.$file_ext;
$writer->save($new_file);
- original file
- write new file
As above, if you save a picture or image of a specific sheet in the original file as a new file, the picture or image will be lost. ex) sheet2
Is there something I'm missing out on?