diff --git a/src/vitis/vas/rest/class/vmlib/files/S3_files.class.inc b/src/vitis/vas/rest/class/vmlib/files/S3_files.class.inc index 17e297a8a89f7e939f7c8dde15755aac3ae2f25c..76fee87b14586e95b6e0fdaece92fa5f6947714e 100644 --- a/src/vitis/vas/rest/class/vmlib/files/S3_files.class.inc +++ b/src/vitis/vas/rest/class/vmlib/files/S3_files.class.inc @@ -440,7 +440,7 @@ class S3_files implements Files{ foreach ($aList["Contents"] as $aObject){ $sObjectPath = str_replace($sListPrefix, "", $aObject["Key"]); $aObjectPath = explode("/", $sObjectPath); - if(!empty($aObjectPath[0])){ + if(!empty($aObjectPath[0]) && !in_array($aObjectPath[0], $aReturn)){ array_push($aReturn, $aObjectPath[0]); } } @@ -588,6 +588,9 @@ class S3_files implements Files{ } if (substr($sListPrefix, -1) !== "/"){ $sListPrefix .= "/"; + } + if (substr($sListPrefixDest, -1) !== "/"){ + $sListPrefixDest .= "/"; } try{ $aList = $this->oS3Client->listObjectsV2(array( @@ -597,8 +600,6 @@ class S3_files implements Files{ if ($aList["KeyCount"] > 0){ foreach ($aList["Contents"] as $aObject){ - array_push($oDeleteParams["Objects"], array("Key"=>$aObject["Key"])); - $this->oS3Client->copyObject(array( 'Bucket' => $sBucket, 'Key' => str_replace($sListPrefix, $sListPrefixDest, $aObject["Key"]),