I am trying to use AmazonS3Client for putObject. The strange thing is, it seems to work when I run my putObject code in the main iOS thread.
The code is basically like this:
-(void)uploadVideoToS3 { S3PutObjectRequest * videoPOR = [[S3PutObjectRequest alloc] initWithKey:video.onlineVideoID inBucket:video.onlineVideoBucketName]; videoPOR.contentType = @"video/quicktime"; videoPOR.data = [NSData dataWithContentsOfURL:video.convertedVideoLocalURL]; videoPOR.delegate = self;
A bucket exists, I have permissions, etc. If I just call
[self uploadVideoToS3]
in my code (which is disconnected from the main thread), the whole video upload method works (I have some NSLogs to prove it), but I never get any status callbacks, no exceptions are thrown, and the object is never put in it bucket on S3.
When I call the load function in the main thread, for example:
dispatch_async(dispatch_get_main_queue(), ^(void) { [self uploadVideoToS3]; });
I get execution callbacks, everything works, and the object successfully fits in the S3 bucket.
Does anyone know if putObject only works on the main iOS thread? If so, this would be unsuccessful, as this is usually a UI thread.
Thanks Kevin
PS I tried to send a function call to a non-main thread with the same unsuccessful result.
source share