Uploading an object
Sample code:
NSString *filePath = [[NSBundle mainBundle]pathForResource:@"fileName" ofType:@"Type"];
OBSPutObjectWithFileRequest *request = [[OBSPutObjectWithFileRequest alloc]initWithBucketName:@"bucketname" objectKey:@"objectname" uploadFilePath:filePath];
// Query the upload progress.
request.uploadProgressBlock = ^(int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend) {
NSLog(@"%0.1f%%",(float)floor(totalBytesSent*10000/totalBytesExpectedToSend)/100);
};
// Upload a file.
[ client putObject:request completionHandler:^(OBSPutObjectResponse *response, NSError *error){
NSLog(@"%@",response.etag);
}];
Last Article: Creating a Bucket
Next Article: Downloading an Object

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.