Zipper icon indicating copy to clipboard operation
Zipper copied to clipboard

Zip files stored in storage folder

Open lawkunchi opened this issue 6 years ago • 1 comments

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 avatar Jan 31 '19 08:01 lawkunchi

ping @Chumper

lawkunchi avatar Jan 31 '19 08:01 lawkunchi