Fix: when downloading entire gallery, the filename were ".zip"
This commit is contained in:
parent
7728d8a90c
commit
1307a621e7
@ -26,6 +26,11 @@ class downloadalbum_Controller extends Controller {
|
|||||||
$album = $this->init($id);
|
$album = $this->init($id);
|
||||||
$files = $this->getFilesList($album);
|
$files = $this->getFilesList($album);
|
||||||
|
|
||||||
|
// ZIP name
|
||||||
|
$zipname = (empty($album->name))
|
||||||
|
? $zipname = 'Gallery.zip' // @todo $zipname = purified_version_of($album->title)
|
||||||
|
: $album->name.'.zip';
|
||||||
|
|
||||||
// Calculate ZIP size (look behind for details)
|
// Calculate ZIP size (look behind for details)
|
||||||
$zipsize = 22;
|
$zipsize = 22;
|
||||||
foreach($files as $f) {
|
foreach($files as $f) {
|
||||||
@ -34,7 +39,7 @@ class downloadalbum_Controller extends Controller {
|
|||||||
|
|
||||||
// Send headers
|
// Send headers
|
||||||
$this->prepareOutput();
|
$this->prepareOutput();
|
||||||
$this->sendHeaders($album->name.'.zip', $zipsize);
|
$this->sendHeaders($zipname, $zipsize);
|
||||||
|
|
||||||
// Generate and send ZIP file
|
// Generate and send ZIP file
|
||||||
// http://www.pkware.com/documents/casestudies/APPNOTE.TXT (v6.3.2)
|
// http://www.pkware.com/documents/casestudies/APPNOTE.TXT (v6.3.2)
|
||||||
|
Reference in New Issue
Block a user