title: AFNetworking how to check if upload operation has finished or failed
body: <p>How can I check if AFNetworking has finished the upload of a file? And how I could check if there were some problems?</p>
  
  <p>this is my code:</p>
  
  <pre><code>AFHTTPClient *client= [AFHTTPClient clientWithBaseURL:[NSURL URLWithString:@"http://server"]];
  NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
  [parameters setObject:[fieldName text] forKey:@"name"];
  [parameters setObject:[fieldSurname text] forKey:@"surname"];
  
  NSMutableURLRequest *myRequest = [client multipartFormRequestWithMethod:@"POST" path:@"/upload.php" parameters:parameters constructingBodyWithBlock: ^(id &lt;AFMultipartFormData&gt;formData) {
      [formData appendPartWithFileData:[[AttachedFile sharedAttachedFile]dataToSend] mimeType:@"image/jpeg" name:@"attach"];
  }];
  
  AFHTTPRequestOperation *operation = [[[AFHTTPRequestOperation alloc] initWithRequest:myRequest] autorelease]; 
  [operation setUploadProgressBlock:^(NSInteger bytesWritten, NSInteger totalBytesWritten, NSInteger totalBytesExpectedToWrite) {
      NSLog(@"Sent %d of %d bytes", totalBytesWritten, totalBytesExpectedToWrite);
  }];
  
  queue = [[[NSOperationQueue alloc] init] autorelease];
  [queue addOperation:operation];
  </code></pre>
  
  <p>which method (and delegate) I should implement?</p>
  
  <p>Thank You!</p>