Reputation: 1457
I am new to AWS and we are trying to upload a file using AWS S3 framework in iOS.
Files are successfully uploading in bucket directly. But not uploading the file in the specific folder.
Like we have a bucket as name "TestBucket" and in that bucket different folders as "uploads".
So file is uploading in "TestBucket" But not uploading in "uploads" folder.
I am using below code for upload the files.
AWSS3TransferUtilityUploadExpression *profileImageUploadExpression = [AWSS3TransferUtilityUploadExpression new];
[profileImageUploadExpression setValue:@"public-read-write" forRequestParameter:@"x-amz-acl"];
AWSS3TransferUtility *transferUtility = [AWSS3TransferUtility defaultS3TransferUtility];
_mediaUploadTask = [transferUtility uploadData:<ImageData> bucket:<Bucket or Folder Path> key:<FileName> contentType:@"image/jpeg" expression:profileImageUploadExpression completionHander:^(AWSS3TransferUtilityUploadTask * _Nonnull task, NSError * _Nullable error) {
// Never called completion when I am uploading file in folder.
}];
Any one can help me.
Upvotes: 1
Views: 708
Reputation: 17186
One possible reason is access rights. If your folders do not have sufficient access rights, it will not allow you to upload the image to the folder.
Upvotes: 2