Skip to content

Cannot add directory #62

@Ancyker

Description

@Ancyker

Adding a directory fails with (vendor\stechstudio\laravel-zipstream\src\Models\LocalFile.php:23):

fopen(/the/path/): failed to open stream: No such file or directory

I'm trying to add a directory without adding any files in it, i.e.

$zip->add('/path/to/dir/', 'dir/');

I just want an empty directory (no files, unless I later add files into it via add()). The idea is something like this:

$zip = new Zip('archive.zip');
$zip->add('/path/to/dir/', 'dir/');
if ($something) $zip->add('/path/to/dir/fle.jpg', 'dir/file.jpg');

I want the dir to exist even if no conditions are met. There doesn't seem to be an obvious way to accomplish this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions