IOException, failed to open stream: operation failed
I keep on getting this error?, why?? I wrote exactly as in the document...
IOException in AbstractReader.php line 90: Could not open lol.xlsx for reading! (XMLReader::open(zip://lol.xlsx#xl\sharedStrings.xml): failed to open stream: operation failed)
Hi @DVendy, Can you try 2 things to narrow down the issue?
- Change the location of the XLSX to make sure it can still be read
- Downgrade to version 1.0.7 (change composer.json: "box/spout": "1.0.7". I changed the way files are read on Windows, it may have broken the reader in some configurations.
Tried both, still failed ...
i have the same problem also tried the things adrilo sugested
found this issue.. i was trying to read a .xls and this library only works with .xlsx
@area722 Spout only works with XLSX files, sorry. @DVendy, can you please share some code? If both solutions did not work, I'm not sure why it failed...
public function import_spout(){
$reader = ReaderFactory::create(Type::XLSX);
$reader->open("data.xlsx");
while ($reader->hasNextSheet()) {
$reader->nextSheet();
while ($reader->hasNextRow()) {
$row = $reader->nextRow();
var_dump($row);
}
}
$reader->close();
}
Just like in documentation. Oh yes and I used it in Laravel framework. Is there any extra configuration for laravel?
The writer working flawlessly btw., :3
Just to be sure, when you downgraded Spout to 1.0.7, did you run composer update to update the source files?
Given the file path you mentioned, it seems like you are using Windows. And I made a change for Windows in the 1.0.8 version so it's really likely to be the cause of your problem.
If you've already done that, can you tell me which version of PHP you're using and if you are using WAMP/XAMPP. Also, if the file does not contain any sensitive data, would you mind sending it to me at adrien [at] box.com? It will help for debugging!
I'm not familiar with Laravel, but there should not be any additional configuration (and the writer works)