{"action":"closed","issue":{"url":"https://api.github.com/repos/pydio/pydio-core/issues/1117","repository_url":"https://api.github.com/repos/pydio/pydio-core","labels_url":"https://api.github.com/repos/pydio/pydio-core/issues/1117/labels{/name}","comments_url":"https://api.github.com/repos/pydio/pydio-core/issues/1117/comments","events_url":"https://api.github.com/repos/pydio/pydio-core/issues/1117/events","html_url":"https://github.com/pydio/pydio-core/issues/1117","id":143302340,"number":1117,"title":"PowerFS in conjunction with xsendfile deletes file to early","user":{"login":"mwehr","id":1297622,"avatar_url":"https://avatars.githubusercontent.com/u/1297622?v=3","gravatar_id":"","url":"https://api.github.com/users/mwehr","html_url":"https://github.com/mwehr","followers_url":"https://api.github.com/users/mwehr/followers","following_url":"https://api.github.com/users/mwehr/following{/other_user}","gists_url":"https://api.github.com/users/mwehr/gists{/gist_id}","starred_url":"https://api.github.com/users/mwehr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwehr/subscriptions","organizations_url":"https://api.github.com/users/mwehr/orgs","repos_url":"https://api.github.com/users/mwehr/repos","events_url":"https://api.github.com/users/mwehr/events{/privacy}","received_events_url":"https://api.github.com/users/mwehr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"ghecquet","id":14858585,"avatar_url":"https://avatars.githubusercontent.com/u/14858585?v=3","gravatar_id":"","url":"https://api.github.com/users/ghecquet","html_url":"https://github.com/ghecquet","followers_url":"https://api.github.com/users/ghecquet/followers","following_url":"https://api.github.com/users/ghecquet/following{/other_user}","gists_url":"https://api.github.com/users/ghecquet/gists{/gist_id}","starred_url":"https://api.github.com/users/ghecquet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghecquet/subscriptions","organizations_url":"https://api.github.com/users/ghecquet/orgs","repos_url":"https://api.github.com/users/ghecquet/repos","events_url":"https://api.github.com/users/ghecquet/events{/privacy}","received_events_url":"https://api.github.com/users/ghecquet/received_events","type":"User","site_admin":false},"assignees":[{"login":"ghecquet","id":14858585,"avatar_url":"https://avatars.githubusercontent.com/u/14858585?v=3","gravatar_id":"","url":"https://api.github.com/users/ghecquet","html_url":"https://github.com/ghecquet","followers_url":"https://api.github.com/users/ghecquet/followers","following_url":"https://api.github.com/users/ghecquet/following{/other_user}","gists_url":"https://api.github.com/users/ghecquet/gists{/gist_id}","starred_url":"https://api.github.com/users/ghecquet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghecquet/subscriptions","organizations_url":"https://api.github.com/users/ghecquet/orgs","repos_url":"https://api.github.com/users/ghecquet/repos","events_url":"https://api.github.com/users/ghecquet/events{/privacy}","received_events_url":"https://api.github.com/users/ghecquet/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/pydio/pydio-core/milestones/11","html_url":"https://github.com/pydio/pydio-core/milestones/6.4.2","labels_url":"https://api.github.com/repos/pydio/pydio-core/milestones/11/labels","id":1678394,"number":11,"title":"6.4.2","description":"Bugfixes and small improvements.","creator":{"login":"cdujeu","id":2465057,"avatar_url":"https://avatars.githubusercontent.com/u/2465057?v=3","gravatar_id":"","url":"https://api.github.com/users/cdujeu","html_url":"https://github.com/cdujeu","followers_url":"https://api.github.com/users/cdujeu/followers","following_url":"https://api.github.com/users/cdujeu/following{/other_user}","gists_url":"https://api.github.com/users/cdujeu/gists{/gist_id}","starred_url":"https://api.github.com/users/cdujeu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdujeu/subscriptions","organizations_url":"https://api.github.com/users/cdujeu/orgs","repos_url":"https://api.github.com/users/cdujeu/repos","events_url":"https://api.github.com/users/cdujeu/events{/privacy}","received_events_url":"https://api.github.com/users/cdujeu/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":13,"state":"open","created_at":"2016-04-01T16:04:43Z","updated_at":"2016-07-07T12:56:59Z","due_on":"2016-07-07T22:00:00Z","closed_at":null},"comments":1,"created_at":"2016-03-24T16:59:32Z","updated_at":"2016-07-07T12:56:59Z","closed_at":"2016-07-07T12:56:59Z","body":"If enabled PowerFS feature is use in conjunction with xsendfile the file is removed to early.\r\nThe 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.\r\n\r\nA quick fix would be to check the usage of the xsendfile and don't register the shutdown hook?\r\nclass.PowerFSController.php\r\nline:86\r\n```PHP\r\ncase \"postcompress_download\":\r\n  $archive = AJXP_Utils::getAjxpTmpDir().DIRECTORY_SEPARATOR.$httpVars[\"ope_id\"].\"_\".AJXP_Utils::sanitize(AJXP_Utils::decodeSecureMagic($httpVars[\"archive_name\"]), AJXP_SANITIZE_FILENAME);\r\n  $fsDriver = AJXP_PluginsService::getInstance()->getUniqueActivePluginForType(\"access\");\r\n  if (is_file($archive)) {\r\n    if (!isset($fsDriver->driverConf['USE_XSENDFILE'])){\r\n      register_shutdown_function(\"unlink\", $archive);\r\n    }\r\n    $fsDriver->readFile($archive, \"force-download\", $httpVars[\"archive_name\"], false, null, true);\r\n    } else {\r\n      echo(\"<script>alert('Cannot find archive! Is ZIP correctly installed?');</script>\");\r\n     }\r\nbreak;\r\n```\r\nhmm,.. just found the topic in the [forum](https://pydio.com/forum/f/topic/action-powerfs-bug-postcompress_downloads-fails-when-xsendfile-enabled/)"}}
{"actor":{"display_login":"ghecquet"}}