Skip to content
This repository has been archived by the owner on Feb 25, 2020. It is now read-only.

Zip files stored in storage folder #147

Open
lawkunchi opened this issue Jan 31, 2019 · 1 comment
Open

Zip files stored in storage folder #147

lawkunchi opened this issue Jan 31, 2019 · 1 comment

Comments

@lawkunchi
Copy link

I'm trying to download multiple files stored in storage folder, but I do get this error
Directory name must not be empty. Below is My Controller

public function downloadZip($id) {

        $user = User::findorFail($id);

        $zipper = new \Chumper\Zipper\Zipper;
        $images = Storage::get($user->images);
        $files = glob($images);
        $zipper->make(public_path('users/images.zip'))->add($files);
        $zipper->make(public_path('users/images.zip'))->extractTo(public_path('users'));
        $zipper->close();
        return response()->download(public_path('users/images.zip'));
    }
@lawkunchi lawkunchi changed the title Glob files stored in storage folder Zip files stored in storage folder Jan 31, 2019
@lawkunchi
Copy link
Author

ping @Chumper

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

No branches or pull requests

1 participant