We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NSString *accessKey = @"admin"; NSString *secretKey = @"admin123456";
//[NSURL URLWithString:[NSString stringWithFormat:@"http://%@:9000", [SPUserInstance sharedInstance].userPrivateIp]] AWSStaticCredentialsProvider *credentialsProvider = [[AWSStaticCredentialsProvider alloc] initWithAccessKey:accessKey secretKey:secretKey]; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 endpoint:[[AWSEndpoint alloc] initWithRegion:AWSRegionUSEast1 service:AWSServiceS3 URL:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@:9000", [SPUserInstance sharedInstance].userPrivateIp]]] credentialsProvider:credentialsProvider]; [AWSS3 registerS3WithConfiguration:configuration forKey:@"test"]; _awss3Client = [AWSS3 S3ForKey:@"test"];
unsigned long long fileSize = [[[NSFileManager defaultManager] attributesOfItemAtPath:fileUrlString error:nil] fileSize];
AWSS3PutObjectRequest *request = [[AWSS3PutObjectRequest alloc] init]; request.bucket = kBucketName; request.key = objectKey; request.body = [NSURL fileURLWithPath:fileUrlString]; request.contentLength = @(fileSize); request.uploadProgress = ^(int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend) { NSLog(@"11111111111 sent = %lld, totalsent = %lld, expecteTotalSent = %lld", bytesSent, totalBytesSent, totalBytesExpectedToSend); progressBlock(bytesSent, totalBytesSent, totalBytesExpectedToSend); }; [[self.awss3Client putObject:request] continueWithBlock:^id _Nullable(AWSTask<AWSS3PutObjectOutput *> * _Nonnull task) { if (task.error) { failedBlock([NSString stringWithFormat:@"%ld", task.error.code], task.error.localizedDescription); } else { successBlock(objectKey); } return nil; }];
The text was updated successfully, but these errors were encountered:
No branches or pull requests
NSString *accessKey = @"admin";
NSString *secretKey = @"admin123456";
unsigned long long fileSize = [[[NSFileManager defaultManager] attributesOfItemAtPath:fileUrlString error:nil] fileSize];
The text was updated successfully, but these errors were encountered: