I want to add Folder in my amazon s3 bucket using coding. Can you please suggest me how to achieve this?
In iOS (Objective-C), I did following way
You can add below code to create a folder inside amazon s3 bucket programmatically. This is working code snippet. Any suggestion Welcome.
-(void)createFolder{
AWSS3PutObjectRequest *awsS3PutObjectRequest = [AWSS3PutObjectRequest new];
awsS3PutObjectRequest.key = [NSString stringWithFormat:@"%@/", @"FolderName"];
awsS3PutObjectRequest.bucket = @"Bucket_Name";
AWSS3 *awsS3 = [AWSS3 defaultS3];
[awsS3 putObject:awsS3PutObjectRequest completionHandler:^(AWSS3PutObjectOutput * _Nullable response, NSError * _Nullable error) {
if (error) {
NSLog(@"error Creating folder");
}else{
NSLog(@"Folder Creating Sucessful");
}
}];
}