Performing a Multipart Copy
As a special case of multipart upload, multipart copy implements multipart upload by copying the whole or part of an object in a bucket. You can call copyPart to copy parts. Sample code is as follows:
static OBSClient *client;
NSString *endPoint = @"your-endpoint";
NSString *SK = @"*** Provide your Secret Key ***";
NSString *AK = @"*** Provide your Access Key ***";
// Initialize identity authentication.
OBSStaticCredentialProvider *credentialProvider = [[OBSStaticCredentialProvider alloc] initWithAccessKey:AK secretKey:SK];
//Initialize service configuration.
OBSServiceConfiguration *conf = [[OBSServiceConfiguration alloc] initWithURLString:endPoint credentialProvider:credentialProvider];
// Initialize an instance of OBSClient.
client = [[OBSClient alloc] initWithConfiguration:conf];
// Copy parts.
OBSCopyPartRequest* copyRequest =
[[OBSCopyPartRequest alloc]initWithSrcBucketName:@"buckeName"
srcObjectKey:@"MultiPart"
uploadBucketName:@"bucketName"
uploadObjectKey:@"MultiPart"
uploadPartNumber:[NSNumber numberWithInt:3]
uploadID:@"uploadID"];
[client copyPart:copyRequest completionHandler:^(OBSCopyPartResponse *response, NSError *error) {
NSLog(@"%@",response);
}]; Last Article: Appendable Upload
Next Article: Performing a Resumable Upload
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.