Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

XLSX reading error "Could not open ....xlsx for reading! " #379

Closed
ahmetkemall opened this issue Feb 2, 2017 · 6 comments
Closed

XLSX reading error "Could not open ....xlsx for reading! " #379

ahmetkemall opened this issue Feb 2, 2017 · 6 comments

Comments

@ahmetkemall
Copy link

Hello,
Sometimes I'm getting this error while trying to open a xlsx ReaderFactory
"Could not open /www/....E8F2A635F.xlsx for reading! (Could not open "xl/sharedStrings.xml".)"

And then trying again it works fine, and again getting this error again.
How can i prevent this error ?

Thank you.

` $reader = ReaderFactory::create(Type::XLSX);
$reader->open($file['path']);

        $indexCount = 0;
        foreach ($reader->getSheetIterator() as $sheet) {
            if($workSheetIndex != $indexCount++)
                continue;

            foreach ($sheet->getRowIterator() as $row) {
                $columns = $row;
                break;
            }
        }

        $reader->close();`
@madflow
Copy link
Contributor

madflow commented Feb 2, 2017

Can you provide a file (with fake data) where this error occurs?

@ahmetkemall
Copy link
Author

@madflow
Copy link
Contributor

madflow commented Feb 2, 2017

I can load the file without any errors. There already is similar Issues here:

#286

and here:

#294

I am not quite sure which one applies - but they seem similar.

From a quick glance: Can you try setting libxml_disable_entity_loader(false); before reading the file and/or renaming it first to "foo.xlsx" in order to rule out filename problems.

@ahmetkemall
Copy link
Author

Rarely this error showing up, the interesting thing when i try for same file again its loading with out errors.

I double checked this issue now #286 it's similar

Have tried libxml_disable_entity_loader no problem until now, if i get similar problem again i will let you know

Thank you so much !

@madflow
Copy link
Contributor

madflow commented Feb 2, 2017

👍 Please kindly close this issue if it is resolved.

@ahmetkemall
Copy link
Author

ahmetkemall commented Feb 3, 2017

After so many tests.
We didn't have a problem.

Thank you..

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

No branches or pull requests

2 participants