diff --git a/app/src/Handlers/ZipHandler.php b/app/src/Handlers/ZipHandler.php index 52205b4..506cbd5 100644 --- a/app/src/Handlers/ZipHandler.php +++ b/app/src/Handlers/ZipHandler.php @@ -64,10 +64,12 @@ class ZipHandler $response->getBody()->write($tempFile->getContents()); + $filename = Collection::make(explode('/', $path))->last(); + return $response->withHeader('Content-Type', 'application/zip') ->withHeader('Content-Disposition', sprintf( 'attachment; filename="%s.zip"', - Collection::make(explode('/', $path))->last() + $filename == '.' ? 'Home' : $filename )); } }