mirror of
https://github.com/DirectoryLister/DirectoryLister.git
synced 2025-08-26 07:15:30 +02:00
Zip downloads generated from the root folder now have the filename 'Home.zip'
This commit is contained in:
@@ -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
|
||||
));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user