IOS AWS s3存储桶映像上载问题

IOS AWS s3存储桶映像上载问题,ios,amazon-s3,Ios,Amazon S3,我已经尝试了一段时间,我知道我已经尝试了数据和流媒体,但没有运气,我假设我不需要像大多数示例中所示创建bucket,因为我想要上传到的bucket已经存在,它还告诉我我正在尝试访问的bucket,但是当我尝试上传时,我得到了这个消息 “将图像上载到S3时出错:您提供的XML格式不正确或未根据我们发布的架构进行验证” 这是密码 UIImage * img = [[[[CurrentGamesInfo sharedCurrentGamesInfo]GameInCreation] GetImageTo

我已经尝试了一段时间,我知道我已经尝试了数据和流媒体,但没有运气,我假设我不需要像大多数示例中所示创建bucket,因为我想要上传到的bucket已经存在,它还告诉我我正在尝试访问的bucket,但是当我尝试上传时,我得到了这个消息

“将图像上载到S3时出错:您提供的XML格式不正确或未根据我们发布的架构进行验证”

这是密码

UIImage * img = [[[[CurrentGamesInfo sharedCurrentGamesInfo]GameInCreation] GetImageToSend]_imageToSend];
    NSData *savedImageData = UIImageJPEGRepresentation(img, 0.8);
    NSString *pictureName = [[[CurrentGamesInfo sharedCurrentGamesInfo]GameInCreation] GetGameID];

    @try 
    {
        AmazonS3Client *s3 = [[[AmazonS3Client alloc] initWithAccessKey:MY_ACCESS_KEY_ID withSecretKey:MY_SECRET_KEY] autorelease];

        //[s3 createBucket:[[[S3CreateBucketRequest alloc] initWithName:MY_PICTURE_BUCKET] autorelease]];
        NSArray *bucketArray = [s3 listBuckets];
        S3Bucket *bucket = [[s3 listBuckets] objectAtIndex:0];
        NSLog(@"%@",[bucket name]);


        S3PutObjectRequest *por = [[[S3PutObjectRequest alloc] initWithKey:pictureName inBucket:MY_PICTURE_BUCKET] autorelease];
        por.contentType = @"image/jpeg";

        //por.data = savedImageData;
        //por.cannedACL   = [S3CannedACL publicRead];

        S3UploadInputStream *stream = [S3UploadInputStream inputStreamWithData:savedImageData];
        //stream.delay = 0.2; 
        //stream.packetSize = 16;
        por.contentLength = [savedImageData length];
        por.stream = stream;

        [s3 putObject:por];      
    }
    @catch (AmazonClientException *exception) 
    {
        NSLog(@"Error uploading image to S3: %@", exception.message);
    }

我做错了什么

无所谓……变量“pictureName”为零……我羞愧地溜走了

无所谓……变量“pictureName”为零……我羞愧地溜走了

别羞愧,这实际上帮助了我。:)我很高兴我的编码错误paus的出版帮助了一些人不要感到羞耻,这实际上帮助了我。:)我很高兴我的编码错误paus的出版帮助了一些人