Zip downloads generated from the root folder now have the filename 'Home.zip'

This commit is contained in:
Chris Kankiewicz
2020-02-17 10:02:04 -07:00
parent 4068482efe
commit 6d2e12cc32

View File

@@ -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
));
}
}