title: Uploading images to Firebase
body: <p>I'm trying to upload images to Firebase like this:</p>
  
  <pre><code>Firebase *ref = [[Firebase alloc] initWithUrl:@"https://&lt;app-name&gt;.firebaseio.com/posts"];
  Firebase *newPost = [ref childByAutoId];
  
  NSDictionary *newPostData = @{
                                @"image" : [self encodeToBase64String:image]
                                };
  [newPost updateChildValues:newPostData];
  </code></pre>
  
  <p>I'm using this code to encode the image:</p>
  
  <pre><code>- (NSString *)encodeToBase64String:(UIImage *)image {
  return [UIImagePNGRepresentation(image) base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];
  }
  </code></pre>
  
  <p>But this does not work as the string exceeds the maximum size:</p>
  
  <p><code>Terminating app due to uncaught exception 'InvalidFirebaseData', reason: '(updateChildValues:) String exceeds max size of 10485760 utf8 bytes:</code></p>
  
  <p>What can I do to resolve this problem? I haven't found anything online in regards to iOS development and images when using Firebase.</p>