-
Notifications
You must be signed in to change notification settings - Fork 61
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
Cannot add directory #62
Comments
Correct, there is no current support in this package for adding empty directories to a zip. |
Could it be added? |
I don't think so. There is no option to add empty folders in the underlying |
$zip = new Zip('archive.zip'); how add directory like that: |
Skip that middle line, don't try to add the directory. Just |
It looks like Here is the docs https://maennchen.dev/ZipStream-PHP/classes/ZipStream-ZipStream.html#method_addDirectory |
Honestly, i need to create blank directory to reflect the real view in the web where folders is empty. And if the user download the parent folder, it include the empty directory. Think like Google Drive, what if some user download a directory and they expect the empty folder in the zip downloaded, but there is not the empty folder? Seems wrong to me. Hopefully you add a support for it. |
I'm glad to see the underlying ZipStream-PHP library has added support. This seems reasonable now. I'm not sure when I'll have time to add this, and would welcome a pull request if someone wants to take a stab at it. |
Adding a directory fails with (
vendor\stechstudio\laravel-zipstream\src\Models\LocalFile.php:23
):I'm trying to add a directory without adding any files in it, i.e.
I just want an empty directory (no files, unless I later add files into it via
add()
). The idea is something like this:I want the dir to exist even if no conditions are met. There doesn't seem to be an obvious way to accomplish this.
The text was updated successfully, but these errors were encountered: