Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix for #1117: don't remove tmp archive if using XSENDFILE
Browse files Browse the repository at this point in the history
  • Loading branch information
ghecquet committed Jul 7, 2016
1 parent c55a1d3 commit 24b8ade
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/src/plugins/action.powerfs/class.PowerFSController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public function switchAction($action, $httpVars, $fileVars)
}
$urlBase = "pydio://". ConfService::getRepository()->getId();
$mess = ConfService::getMessages();

switch ($action) {

case "monitor_compression" :
Expand Down Expand Up @@ -86,9 +87,14 @@ public function switchAction($action, $httpVars, $fileVars)
case "postcompress_download":

$archive = AJXP_Utils::getAjxpTmpDir().DIRECTORY_SEPARATOR.$httpVars["ope_id"]."_".AJXP_Utils::sanitize(AJXP_Utils::decodeSecureMagic($httpVars["archive_name"]), AJXP_SANITIZE_FILENAME);

$fsDriver = AJXP_PluginsService::getInstance()->getUniqueActivePluginForType("access");
if (is_file($archive)) {
register_shutdown_function("unlink", $archive);
if(!$fsDriver->getFilteredOption("USE_XSENDFILE", ConfService::getRepository())
&& !$fsDriver->getFilteredOption("USE_XACCELREDIRECT", ConfService::getRepository())) {
register_shutdown_function("unlink", $archive);
}

$fsDriver->readFile($archive, "force-download", $httpVars["archive_name"], false, null, true);
} else {
echo("<script>alert('Cannot find archive! Is ZIP correctly installed?');</script>");
Expand Down

0 comments on commit 24b8ade

Please sign in to comment.