0
votes

I try to save CS with Laravel Excel.

Excel::create($filename, function($excel) {
            $excel->sheet('Excel sheet', function($sheet) {
                $sheet-> loadView('csv.csv')->with('data',$this -> pdfData);
                $sheet-> setOrientation('landscape');
       });
})->store('csv', public_path(''))

But i got error:

ErrorException in Filesystem.php line 337: mkdir(): File exists in Filesystem.php line 337 at HandleExceptions->handleError('2', 'mkdir(): File exists', '/var/www/dir/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php', '337', array('path' => '/var/www/dir/public', 'mode' => '511', 'recursive' => true, 'force' => false))

I think its permission error, but i dont know what i need to do. I hope someone can help me. Thanks

1
Its work on localhost, but not work in linux srvketom
create a folder in the public path and save the csv in that folder.. give 664 permission on that folder as wellMihai Matei

1 Answers

0
votes

chown root:www-data public/ helps on me Thanks all!