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

Error if the file is empty #8

Closed
visavi opened this issue Nov 10, 2017 · 5 comments
Closed

Error if the file is empty #8

visavi opened this issue Nov 10, 2017 · 5 comments

Comments

@visavi
Copy link

visavi commented Nov 10, 2017

Get entry contents.

// $entryName = 'path/to/example-entry-name.txt';

$contents = $zipFile[$entryName];
Checks whether a entry exists.

// $entryName = 'path/to/example-entry-name.txt';

$hasEntry = isset($zipFile[$entryName]);

if the file exists, but it is empty (0 bytes), then an error is displayed
ErrorException (E_WARNING)
fread (): Length parameter must be greater than 0

I think this is not correct, since the file can be empty in the archive

@Ne-Lexa
Copy link
Owner

Ne-Lexa commented Nov 10, 2017

This is a bug, and it has already been resolved in the forthcoming release of version 3.1.0, as well as much more. In addition, version 3.0.3 will be released with the closure of this error.

@Ne-Lexa
Copy link
Owner

Ne-Lexa commented Nov 11, 2017

Bug fixed. Upgrade to version 3.0.3.

@visavi
Copy link
Author

visavi commented Nov 14, 2017

Тут тоже

throw new InvalidArgumentException("Output filename is empty.");

если файл пустой выкидывает exception, хотя может так и надо

кстати не хватает функционала Content-Disposition: inline; чтобы не скачивало, а выводило в браузере
p.s. хотя нет, это я перепутал, я думал этот метод позволяет скачивать файлы из архива

@Ne-Lexa
Copy link
Owner

Ne-Lexa commented Nov 14, 2017

если файл пустой выкидывает exception, хотя может так и надо

Так и надо. Хотя HTTP спецификация не запрещает, поэтому в следующей версии будет поддержка пустого имени файла для сохранения.

кстати не хватает функционала Content-Disposition: inline; чтобы не скачивало, а выводило в браузере

Будет в следующей версии.

@Ne-Lexa
Copy link
Owner

Ne-Lexa commented Nov 14, 2017

Вышел релиз 3.1.0, в котором, среди прочего, добален недостающий функционал с Content-Disposition: inline.

@Ne-Lexa Ne-Lexa closed this as completed Nov 17, 2017
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