title: AfNetworking Upload stops and eventually times out ONLY over 3G
body: <p>I am attempting to upload a large file from iOS to a server</p>
  
  <p>My code starts the webservce and after uploading ~180000 bytes it hangs, waits, and eventually times out.</p>
  
  <p>As the code currently sits. (I have changed alot trying to troubleshoot)</p>
  
  <pre><code>AFHTTPClient *uploadClient = [[AFHTTPClient alloc] initWithBaseURL:[NSURL URLWithString:k_WebService_Root]];
  
  
  NSMutableDictionary *parameters = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                     @"secret"                  , @"Token",
                                     nil];
  NSDictionary *requestObject = [NSDictionary dictionaryWithObject:parameters forKey:@"request"];
  NSString *endpoint = [self makeEndpointWithService:k_ServiceEndpoint_Message andAction:k_WebService_Message_Upload];
  
  NSMutableURLRequest *request = [uploadClient multipartFormRequestWithMethod:@"POST" path:endpoint parameters:requestObject constructingBodyWithBlock:^(id&lt;AFMultipartFormData&gt; formData) {
      NSData *data = [NSData dataWithContentsOfFile: videoFile.path];
      [formData appendPartWithFileData:data name:@"file" fileName:@"message.mov" mimeType:@"video/quicktime"];
  }];
  
  AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
  
  [operation setUploadProgressBlock:^(NSInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) {
      NSLog(@"Sent %lld of %lld bytes", totalBytesWritten, totalBytesExpectedToWrite);
  }];
  
  [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
      NSLog(@"Success");
  } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
      NSLog(@"Fail\n%@", error);
  }];
  
  
  [operation start];
  </code></pre>
  
  <p>The Output always looks like this</p>
  
  <pre>
  2012-07-30 12:42:20.747 BMP[3290:3503] Sent 32768 of 2316966 bytes
  2012-07-30 12:42:20.754 BMP[3290:3503] Sent 65536 of 2316966 bytes
  2012-07-30 12:42:20.760 BMP[3290:3503] Sent 98304 of 2316966 bytes
  2012-07-30 12:42:20.765 BMP[3290:3503] Sent 131072 of 2316966 bytes
  2012-07-30 12:42:21.113 BMP[3290:3503] Sent 133452 of 2316966 bytes
  2012-07-30 12:42:21.351 BMP[3290:3503] Sent 136148 of 2316966 bytes
  2012-07-30 12:42:21.610 BMP[3290:3503] Sent 138844 of 2316966 bytes
  2012-07-30 12:42:21.940 BMP[3290:3503] Sent 141540 of 2316966 bytes
  2012-07-30 12:42:22.030 BMP[3290:3503] Sent 144236 of 2316966 bytes
  2012-07-30 12:42:22.120 BMP[3290:3503] Sent 146932 of 2316966 bytes
  2012-07-30 12:42:22.142 BMP[3290:3503] Sent 149628 of 2316966 bytes
  2012-07-30 12:42:22.170 BMP[3290:3503] Sent 152324 of 2316966 bytes
  2012-07-30 12:42:22.209 BMP[3290:3503] Sent 155020 of 2316966 bytes
  2012-07-30 12:42:22.240 BMP[3290:3503] Sent 157716 of 2316966 bytes
  2012-07-30 12:42:22.488 BMP[3290:3503] Sent 160412 of 2316966 bytes
  2012-07-30 12:42:22.668 BMP[3290:3503] Sent 163108 of 2316966 bytes
  2012-07-30 12:42:22.900 BMP[3290:3503] Sent 163840 of 2316966 bytes
  2012-07-30 12:42:23.003 BMP[3290:3503] Sent 167152 of 2316966 bytes
  2012-07-30 12:42:23.141 BMP[3290:3503] Sent 171196 of 2316966 bytes
  2012-07-30 12:42:23.181 BMP[3290:3503] Sent 173892 of 2316966 bytes
  2012-07-30 12:42:23.211 BMP[3290:3503] Sent 176588 of 2316966 bytes
  2012-07-30 12:42:23.251 BMP[3290:3503] Sent 179284 of 2316966 bytes
  2012-07-30 12:42:23.303 BMP[3290:3503] Sent 181980 of 2316966 bytes
  2012-07-30 12:42:23.353 BMP[3290:3503] Sent 184676 of 2316966 bytes
  2012-07-30 12:42:23.416 BMP[3290:3503] Sent 187372 of 2316966 bytes
  </pre>
  
  <p>And then after a few minutes i get a Timeout from AFNetworking</p>
  
  <p>Any Ideas?</p>
  
  <p>UPDATE :::
  Apparently it only happens while uploading over 3G</p>