示例#1
0
 /**
  * @return bool
  */
 public function Finish($obBucket = null)
 {
     if ($this->isStarted()) {
         $ar = $this->GetArray();
         if ($obBucket == null) {
             $obBucket = new CCloudStorageBucket(intval($ar["BUCKET_ID"]));
         }
         if (!$obBucket->Init()) {
             return false;
         }
         $arUploadInfo = unserialize($ar["NEXT_STEP"]);
         $bSuccess = $obBucket->GetService()->CompleteMultipartUpload($obBucket->GetBucketArray(), $arUploadInfo);
         if ($bSuccess) {
             $this->Delete();
         }
         $this->DeleteOld();
         return $bSuccess;
     }
     return false;
 }