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

Commit 24b8ade

Browse files
committed
Fix for #1117: don't remove tmp archive if using XSENDFILE
1 parent c55a1d3 commit 24b8ade

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

core/src/plugins/action.powerfs/class.PowerFSController.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public function switchAction($action, $httpVars, $fileVars)
4646
}
4747
$urlBase = "pydio://". ConfService::getRepository()->getId();
4848
$mess = ConfService::getMessages();
49+
4950
switch ($action) {
5051

5152
case "monitor_compression" :
@@ -86,9 +87,14 @@ public function switchAction($action, $httpVars, $fileVars)
8687
case "postcompress_download":
8788

8889
$archive = AJXP_Utils::getAjxpTmpDir().DIRECTORY_SEPARATOR.$httpVars["ope_id"]."_".AJXP_Utils::sanitize(AJXP_Utils::decodeSecureMagic($httpVars["archive_name"]), AJXP_SANITIZE_FILENAME);
90+
8991
$fsDriver = AJXP_PluginsService::getInstance()->getUniqueActivePluginForType("access");
9092
if (is_file($archive)) {
91-
register_shutdown_function("unlink", $archive);
93+
if(!$fsDriver->getFilteredOption("USE_XSENDFILE", ConfService::getRepository())
94+
&& !$fsDriver->getFilteredOption("USE_XACCELREDIRECT", ConfService::getRepository())) {
95+
register_shutdown_function("unlink", $archive);
96+
}
97+
9298
$fsDriver->readFile($archive, "force-download", $httpVars["archive_name"], false, null, true);
9399
} else {
94100
echo("<script>alert('Cannot find archive! Is ZIP correctly installed?');</script>");

0 commit comments

Comments
 (0)