Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Uncaught ValueError: XMLReader::open(): Argument #1 ($uri) cannot be empty #177

Open
BoltUIX opened this issue Apr 25, 2022 · 1 comment

Comments

@BoltUIX
Copy link

BoltUIX commented Apr 25, 2022

I tried to upload xlsx
Fatal error: Uncaught ValueError: XMLReader::open(): Argument #1 ($uri) cannot be empty in C:\MAMP\htdocs\excel9\library\SpreadsheetReader_XLSX.php:959 Stack trace: #0 C:\MAMP\htdocs\excel9\library\SpreadsheetReader_XLSX.php(959): XMLReader->open('') #1 C:\MAMP\htdocs\excel9\library\SpreadsheetReader.php(238): SpreadsheetReader_XLSX->rewind() #2 C:\MAMP\htdocs\excel9\excelUpload.php(24): SpreadsheetReader->rewind() #3 {main} thrown in C:\MAMP\htdocs\excel9\library\SpreadsheetReader_XLSX.php on line 959

Here is my full code:
https://coding-zon.blogspot.com/2022/04/import-excel-file-into-mysql-in-php.html

@Krezalis
Copy link

Krezalis commented Jun 26, 2022

Discovered problem. When users download XLSX from Google Sheets in xl\workbook.xml we see next items:
<sheet name="Sheet 1" sheetId="1" state="visible" r:id="rId2"/>
When we open this file and save in Office Excel its convert to:
<sheet name="Плахта" sheetId="1" r:id="rId1"/>

in SpreadsheetReader_XLSX.php:373 we see attrributes filter $Attributes = $Sheet -> attributes('r', true);
so its not correct.

My fix: replace to $Attributes = $Sheet -> attributes();
replace ($Name == 'id') to if ($Name == 'sheetId')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants