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

[Bug]: Could not find zip member zip:///{filePath}.xlsx#_rels\.rels when specifying the disk #4052

Closed
1 task done
attac-t opened this issue Dec 18, 2023 · 5 comments
Closed
1 task done
Labels

Comments

@attac-t
Copy link

attac-t commented Dec 18, 2023

Is the bug applicable and reproducable to the latest version of the package and hasn't it been reported before?

  • Yes, it's still reproducable

What version of Laravel Excel are you using?

3.1.51

What version of Laravel are you using?

10.37

What version of PHP are you using?

8.1

Describe your issue

When importing a .xlsx file and the disk parameter is explicitly specified within the Excel::import() method, the following error is provided: Could not find zip member zip:///{filePath}.xlsx#_rels.rels

Excel::import(
   (new ImportClass),
   $filePath,
   'local'
);

This is only happening when explicitly specifying the disk. When the disk is not specified, the package will take the default disk as specified within the docs and the import works as should. In such case, I confirm that the default disk is set as 'local'.

How can the issue be reproduced?

Refer to description.

What should be the expected behaviour?

Specifying the disk shouldn't break the import.

@attac-t attac-t added the bug label Dec 18, 2023
@patrickbrouwers
Copy link
Member

Possible to PR a failing unit test for this?

@ronaldwanink
Copy link

ronaldwanink commented Jan 24, 2024

Same problem here, but without specifying the disk.
PHP 8.1 on Mac M1

Update: My xlsx file started with a space, this seems to cause trouble

@patrickbrouwers
Copy link
Member

Please share more information if you want this bug to be looked into. With "same problem", there's is literally nothing I can do to investigate. Please provide a failing unit test.

@ronaldwanink
Copy link

Sorry, was in a hurry to fix issues. Having tried to reproduce, it seems importing any non-existing xlsx file leads to the aforementioned error.

Import I do with (new MyImport)->withOutput($this->output)->import($file);

I am importing in a Laravel console command handle().

@patrickbrouwers
Copy link
Member

I've added an explicit exception when a file does not exist now

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

No branches or pull requests

3 participants