PHPOffice / PhpSpreadsheet

A pure PHP library for reading and writing spreadsheet files
https://phpspreadsheet.readthedocs.io
MIT License
13.36k stars 3.47k forks source link

Cannot open XLSX file #4046

Closed don-odyssey closed 1 month ago

don-odyssey commented 5 months ago

This is:

- [X] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

File opens for processing

What is the current behavior?

File fails to open Error: atal error: Uncaught PhpOffice\PhpSpreadsheet\Reader\Exception: Unable to identify a reader for this file in /home/httpd/www/odyssey-new/web/php/phplib/ext/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IOFactory.php:172

What are the steps to reproduce?

$icargoInputFile = target file $inputFileType = IOFactory::identify($icargoInputFile); The above lines causes error

Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:

<?php

require __DIR__ . '/vendor/autoload.php';

// Create new Spreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();

// add code that show the issue here...

If this is an issue with reading a specific spreadsheet file, then it may be appropriate to provide a sample file that demonstrates the problem; but please keep it as small as possible, and sanitize any confidential information before uploading.

What features do you think are causing the issue

Does an issue affect all spreadsheet file formats? If not, which formats are affected?

I only use XLSX format

Which versions of PhpSpreadsheet and PHP are affected?

PHP 7.4. I don't know how to find the version of PhpSpreadsheet

oleibman commented 5 months ago

If the file is encrypted (probably because it's password-protected), we can't open it. If that's not the explanation, I'd need you to upload it to determine the source of the problem.

oleibman commented 1 month ago

Closing. No sample file, no reply in over 4 months.