Changeset 159e7df for app/Http/Controllers/Dashboard/FoldersController.php
- Timestamp:
- 10/24/21 21:42:47 (3 years ago)
- Branches:
- develop, master
- Children:
- 169fcc8
- Parents:
- 1c17e70
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Http/Controllers/Dashboard/FoldersController.php
r1c17e70 r159e7df 284 284 $path = Storage::disk('uploads')->path($folder->department->location . DIRECTORY_SEPARATOR . $folder->name); 285 285 286 $files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path));287 288 $filesInDoc = $FileSystem->allFiles($path); 289 290 if(empty(!$filesInDoc)) { 286 try { 287 $files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path)); 288 289 $filesInDoc = $FileSystem->allFiles($path); 290 291 291 foreach ($files as $file) { 292 292 if (!$file->isDir()) { … … 300 300 $headers = array('Content-Type' => 'application/octet-stream',); 301 301 $zip_new_name = Carbon::now()->format('d.m.Y - H:i') . $folder->name . '.zip'; 302 303 } 304 else{302 return response()->download($zip_file, $zip_new_name, $headers); 303 } 304 catch (\Exception $e) { 305 305 Alert::flash("This folder has no files", "warning"); 306 306 return redirect()->back(); 307 307 } 308 309 308 } 310 309
Note:
See TracChangeset
for help on using the changeset viewer.