Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 9ad8c73

Browse files
committed
BUG: refs #0361. Fix downloading of zips
We had newlines prepended and a warning added at the end of our zip file, which was breaking the windows opener (and probably others too...)
1 parent 0ce2b2d commit 9ad8c73

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

core/controllers/DownloadController.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ public function indexAction()
134134
}
135135
else
136136
{
137+
while(ob_get_level() > 0)
138+
{
139+
ob_end_clean();
140+
}
141+
ob_start();
137142
Zend_Loader::loadClass('ZipStream', BASE_PATH.'/library/ZipStream/');
138143
$this->_helper->viewRenderer->setNoRender();
139144
$name = $revision->getItem()->getName();
@@ -144,6 +149,7 @@ public function indexAction()
144149
$zip->add_file_from_path($bitstream->getName(), $bitstream->getAssetstore()->getPath().'/'.$bitstream->getPath());
145150
}
146151
$zip->finish();
152+
exit();
147153
}
148154
}
149155
else
@@ -175,9 +181,16 @@ public function indexAction()
175181
{
176182
$name = "Custom";
177183
}
184+
185+
while(ob_get_level() > 0)
186+
{
187+
ob_end_clean();
188+
}
189+
ob_start();
178190
$zip = new ZipStream($name.'.zip');
179191
$zip = $this->_createZipRecursive($zip, '', $folders, $revisions);
180192
$zip->finish();
193+
exit();
181194
}
182195
}//end index
183196

0 commit comments

Comments
 (0)