title: Base64 image from IOS to php service
body: <p>If I send the image to php server, only in base64, the percentage of transmission is almost zero due to special characters (eg + * /).
  If I send so it is successfully sent, but the image appears without data on the server. Somebody help how to solve this, side php?</p>
  
  <pre><code>string = [imageData base64EncodedStringWithOptions:kNilOptions];  // iOS 7+
  
  NSString *encodedString = (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(
                                                                                    NULL,
                                                                                    (CFStringRef)string,
                                                                                    NULL,
                                                                                    CFSTR("!*'();:@&amp;=+$,/?%#[]\" "),
                                                                                    kCFStringEncodingUTF8));
  </code></pre>
  
  <p>NSString *urlString2= [NSString stringWithFormat: @"mylink.com/xyz"];</p>
  
  <pre><code>NSString *jsonString2= [NSString stringWithFormat: @"{\"id_sala\":\"%@\",\"base\":\"%@\",\"tipo\":\"IOS\"}",iddsala,encodedString];
   NSLog(@"%@",encodedString);
  
  NSData* responseData2 = nil;
  NSURL *url2=[NSURL URLWithString:[urlString2 stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
  responseData2 = [NSMutableData data] ;
  NSMutableURLRequest *request2=[NSMutableURLRequest requestWithURL:url2];
  NSString *bodydata2=[NSString stringWithFormat:@"%@",jsonString2];
  
  [request2 setHTTPMethod:@"POST"];
  NSData *req2=[NSData dataWithBytes:[bodydata2 UTF8String] length:[bodydata2 length]];
  [request2 setHTTPBody:req2];
  NSURLResponse* response2;
  NSError* error2 = nil;
  responseData2 = [NSURLConnection sendSynchronousRequest:request2     returningResponse:&amp;response2 error:&amp;error2];
  responseString2 = [[NSString alloc] initWithData:responseData2 encoding:NSUTF8StringEncoding];
  </code></pre>