Updated on 2022-09-16 GMT+08:00
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); }];
For more information, see Object Upload.
Parent topic: Quick Start
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot