You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Upload Object
Append Upload (iOS SDK)
Copy page
Download PDF
Append Upload (iOS SDK)
This interface is used for appending data to objects. Objects created via the AppendObject interface are classified as Appendable Objects, while objects uploaded using the PutObject interface are classified as Normal Objects.​
Sample Code​
The following code demonstrates how to append objects to the target bucket.​
​
​
TOSCredential *credential = [[TOSCredential alloc] initWithAccessKey:@"accesskey" secretKey:@"secretkey" securityToken:@"securityToken"];​
TOSEndpoint *tosEndpoint = [[TOSEndpoint alloc] initWithURLString:@"endpoint" withRegion:@"region"];​
TOSClientConfiguration *config = [[TOSClientConfiguration alloc] initWithEndpoint:tosEndpoint credential:credential];​
TOSClient *client = [[TOSClient alloc] initWithConfiguration:config];​
​
TOSAppendObjectInput *append = [TOSAppendObjectInput new];​
append.tosBucket = @"bucket-name";​
append.tosKey = @"object-name";​
append.tosOffset = 0;​
append.tosContent = your_data; // NSData​
TOSTask *task = [client putObjectFromFile:append];​
[task continueWithBlock:^id(TOSTask *task) {​
if (!task.error) {​
NSLog(@"Append object success.");​
TOSPutObjectFromFileOutput *output = task.result;​
} else {​
NSLog(@"Append object failed, error: %@" ,task.error);​
}​
return nil;​
}];​
​
​
Last updated: 2025.09.25 16:40:51