From 5e54b71f49926f16827dc95ccc48ac19847ec8dd Mon Sep 17 00:00:00 2001 From: Thomas Cresson Date: Thu, 25 Jul 2013 15:52:45 +0200 Subject: [PATCH] can now upload multiple files through Jumploader on a FTP repository --- .../class.JumploaderProcessor.php | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/core/src/plugins/uploader.jumploader/class.JumploaderProcessor.php b/core/src/plugins/uploader.jumploader/class.JumploaderProcessor.php index 7e8922ac67..ceaac3140c 100644 --- a/core/src/plugins/uploader.jumploader/class.JumploaderProcessor.php +++ b/core/src/plugins/uploader.jumploader/class.JumploaderProcessor.php @@ -28,12 +28,12 @@ */ class JumploaderProcessor extends AJXP_Plugin { - /** - * Handle UTF8 Decoding - * - * @var unknown_type - */ - private static $skipDecoding = false; + /** + * Handle UTF8 Decoding + * + * @var unknown_type + */ + private static $skipDecoding = false; private static $remote = false; private static $partitions = array(); @@ -61,8 +61,8 @@ public function preProcess($action, &$httpVars, &$fileVars){ $index = $httpVars["partitionIndex"]; $realName = $fileVars["userfile_0"]["name"]; - /* if fileId is not set, request for cross-session resume (only if the protocol is not ftp)*/ - if(!isSet($httpVars["fileId"])) { + /* if fileId is not set, request for cross-session resume (only if the protocol is not ftp)*/ + if(!isSet($httpVars["fileId"])) { AJXP_LOGGER::debug("Cross-Session Resume request"); $plugin = AJXP_PluginsService::findPlugin("access", $repository->getAccessType()); @@ -113,11 +113,11 @@ public function preProcess($action, &$httpVars, &$fileVars){ AJXP_LOGGER::debug("Partitioned upload"); $fileId = $httpVars["fileId"]; $fileHash = md5($realName); - + /* In order to enable cross-session resume, temp files must not depend on session. * Now named after and md5() of the original file name. */ - AJXP_LOGGER::debug("Filename: " . $realName . ", File hash: " . $fileHash); + AJXP_LOGGER::debug("Filename: " . $realName . ", File hash: " . $fileHash); $fileVars["userfile_0"]["name"] = "$fileHash.$fileId.$index"; $httpVars["lastPartition"] = false; } @@ -131,15 +131,15 @@ public function preProcess($action, &$httpVars, &$fileVars){ public function postProcess($action, $httpVars, $postProcessData){ if(isSet($httpVars["simple_uploader"]) || isSet($httpVars["xhr_uploader"])) return; - /* If set resumeFileId and resumePartitionIndex, cross-session resume is requested. */ - if(isSet($httpVars["resumeFileId"]) && isSet($httpVars["resumePartitionIndex"])) { - header("HTTP/1.1 200 OK"); - - print("fileId: " . $httpVars["resumeFileId"] . "\n"); - print("partitionIndex: " . $httpVars["resumePartitionIndex"]); - - return; - } + /* If set resumeFileId and resumePartitionIndex, cross-session resume is requested. */ + if(isSet($httpVars["resumeFileId"]) && isSet($httpVars["resumePartitionIndex"])) { + header("HTTP/1.1 200 OK"); + + print("fileId: " . $httpVars["resumeFileId"] . "\n"); + print("partitionIndex: " . $httpVars["resumePartitionIndex"]); + + return; + } /*if(self::$skipDecoding){