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

Commit

Permalink
BUG: refs #0361. Fix downloading of zips
Browse files Browse the repository at this point in the history
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...)
  • Loading branch information
zachmullen committed Nov 17, 2011
1 parent 0ce2b2d commit 9ad8c73
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions core/controllers/DownloadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ public function indexAction()
}
else
{
while(ob_get_level() > 0)
{
ob_end_clean();
}
ob_start();
Zend_Loader::loadClass('ZipStream', BASE_PATH.'/library/ZipStream/');
$this->_helper->viewRenderer->setNoRender();
$name = $revision->getItem()->getName();
Expand All @@ -144,6 +149,7 @@ public function indexAction()
$zip->add_file_from_path($bitstream->getName(), $bitstream->getAssetstore()->getPath().'/'.$bitstream->getPath());
}
$zip->finish();
exit();
}
}
else
Expand Down Expand Up @@ -175,9 +181,16 @@ public function indexAction()
{
$name = "Custom";
}

while(ob_get_level() > 0)
{
ob_end_clean();
}
ob_start();
$zip = new ZipStream($name.'.zip');
$zip = $this->_createZipRecursive($zip, '', $folders, $revisions);
$zip->finish();
exit();
}
}//end index

Expand Down

0 comments on commit 9ad8c73

Please sign in to comment.