Parse PFFile save error

82 views Asked by At

I have an app that was using Parse API + server. I recently migrated it to AWS server and MongoDB. After the migration, I'm seeing that PFFiles are failing to get saved to the server that are more than around 800 KBs. I am basically using image picker to get an image from user and then saving it in the following manner.

-(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
            }

        }];

    }];
}

Below is the error description Im getting -

Error: Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}

Appreciate any help.

0

There are 0 answers