我有一个使用Parse API +服务器的应用。我最近将它迁移到了AWS服务器和MongoDB。迁移之后,我发现PFFiles无法保存到服务器,大于800 KB左右。我基本上使用图像选择器从用户那里获取图像,然后以下面的方式保存它。
$scope.selectedOption = "A";
$scope.lastSelectedOption = "A";
$scope.handleSelection = function(){
console.log("Selected Item: "+$scope.selectedOption);
console.log("Last Selected Item:" + $scope.lastSelectedOption);
console.log("");
$scope.lastSelectedOption = $scope.selectedOption;
}`
以下是我得到的错误说明 -
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *pickedImage = [info objectForKey:UIImagePickerControllerOriginalImage];
[self dismissViewControllerAnimated:YES completion:^{
NSError *fileError;
NSData *imageData = UIImageJPEGRepresentation(_selectedImage, .9);
PFFile *imageFile = [PFFile fileWithName:@"pimg.jpg" data:imageData contentType:@"image/jpeg" error:&fileError];
if(fileError) {
[Utilities popUpMessage:@"file error"];
}
[imageFile saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
if(!error) {
//SUCCESS
} else {
NSLog(@"Error: %@",error.debugDescription);
//FAILURE
}
}];
}];
}
感谢任何帮助。