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

Commit

Permalink
can now upload multiple files through Jumploader on a FTP repository
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasCresson committed Jul 25, 2013
1 parent 0861135 commit 5e54b71
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions core/src/plugins/uploader.jumploader/class.JumploaderProcessor.php
Expand Up @@ -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();

Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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;
}
Expand All @@ -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){
Expand Down

0 comments on commit 5e54b71

Please sign in to comment.