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]: Trying file_get_contents() on a folder #49

Open
sitroz-oz opened this issue Apr 4, 2024 · 0 comments
Open

[Bug]: Trying file_get_contents() on a folder #49

sitroz-oz opened this issue Apr 4, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@sitroz-oz
Copy link

What happened?

I receive
PHP Notice: file_get_contents(): Read of 8192 bytes failed with errno=21 Is a directory in /.../vendor/kiwilan/php-archive/src/Processes/SevenZipProcess.php on line 155
when i tries to read content from array
$files = $zip->getFiles();

I'm try to read ZIP archive with subfolders. And i can't normaly get info if it's dir.
This is my code:
image

Output with dump filenames and extensions:

array:2 [
"$file->getFilename()" => "Бух.отч. от аудиторов полная 2017"
"$file->getExtension()" => " от аудиторов полная 2017"
] // app/Services/ExternalSources/EDisclosure.php:273
PHP Notice: file_get_contents(): Read of 8192 bytes failed with errno=21 Is a directory in /home/www/dev.eninvs.com/vendor/kiwilan/php-archive/src/Processes/SevenZipProcess.php on line 155

Notice: file_get_contents(): Read of 8192 bytes failed with errno=21 Is a directory in /home/www/dev.eninvs.com/vendor/kiwilan/php-archive/src/Processes/SevenZipProcess.php on line 155
"skipping folder or empty file: Бух.отч. от аудиторов полная 2017"
array:2 [
"$file->getFilename()" => "Аудиторское заключ. 2017.pdf"
"$file->getExtension()" => "pdf"
]
array:2 [
"$file->getFilename()" => "Баланс и ОФР 2017.pdf"
"$file->getExtension()" => "pdf"
]
array:2 [
"$file->getFilename()" => "Отчет о движении ден.средств 2017.pdf"
"$file->getExtension()" => "pdf"
]

How to reproduce the bug

If you want repeat it then read all files in loop in archive with subfolders. Subfolders should contain dots in it's name.

Package Version

2.1.02

PHP Version

8.1.27

Which operating systems does with happen with?

Linux

Notes

No response

@sitroz-oz sitroz-oz added the bug Something isn't working label Apr 4, 2024
@ewilan-riviere ewilan-riviere self-assigned this Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants