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

PowerFS in conjunction with xsendfile deletes file to early #1117

Closed
mwehr opened this issue Mar 24, 2016 · 1 comment
Closed

PowerFS in conjunction with xsendfile deletes file to early #1117

mwehr opened this issue Mar 24, 2016 · 1 comment
Assignees
Milestone

Comments

@mwehr
Copy link
Contributor

mwehr commented Mar 24, 2016

If enabled PowerFS feature is use in conjunction with xsendfile the file is removed to early.
The current code uses script a shutdown hook to unlink the archive file at script end. With xsendfile enabled the upload process is handover to Apache and so the script exists and removes the generated archive file to early.

A quick fix would be to check the usage of the xsendfile and don't register the shutdown hook?
class.PowerFSController.php
line:86

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)) {
    if (!isset($fsDriver->driverConf['USE_XSENDFILE'])){
      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>");
     }
break;

hmm,.. just found the topic in the forum

@cdujeu cdujeu modified the milestones: 6.4.1, 6.4.2 Mar 28, 2016
@ghecquet ghecquet self-assigned this Jul 5, 2016
@ghecquet
Copy link
Member

ghecquet commented Jul 7, 2016

It will be available in next release

@ghecquet ghecquet closed this as completed Jul 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants