The path is not writeable using Chumper\Zipper Error?

Posted 10 months ago by Edris899

Hi there,

Using:

Laravel 5.6 Ubuntu 17.xx LTS

I am trying to test a Laravel 5 package called Chumper\Zipper. The idea is to zip selected photos and download it.

But to test it first I got this example from there github page. But it's throwing me a error the the path is not writeable.

Which path? And how to fix? Any ideas?

The error.

The path "test.zip" is not writeable

This is the controller code.

 public function zipPhotos(Request $request){

        $zipper = new \Chumper\Zipper\Zipper;
        $zipper->make('test.zip')->folder('test')->add('composer.json');
        $zipper->zip('test.zip')->folder('test')->add('composer.json','test');
        $zipper->remove('composer.lock');

        $zipper->folder('mySuperPackage')->add(
            array(
                'vendor',
                'composer.json'
            )
        );
        $zipper->getFileContent('mySuperPackage/composer.json');
        $zipper->make('test.zip')->extractTo('',array('mySuperPackage/composer.json'),Zipper::WHITELIST);
        $zipper->close();
        

        return response()->download('test.zip')->deleteFileAfterSend(true);

    }

This is the route.

Route::get('zipPhotos', '[email protected]')->name('zipPhotos');

Thanks in advance.

Please sign in or create an account to participate in this conversation.