From 73e113764954483f4cf55a8f1fb759072c927355 Mon Sep 17 00:00:00 2001 From: Mattt Thompson Date: Thu, 13 Oct 2011 13:29:14 -0500 Subject: [PATCH] Fixing file upload to match 0.7 API (Thanks, @Hunter) --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index c5b2e1d..75ce46a 100644 --- a/README.md +++ b/README.md @@ -66,10 +66,7 @@ NSMutableURLRequest *request = [[AFHTTPClient sharedClient] multipartFormRequest [formData appendPartWithFileData:data mimeType:@"image/jpeg" name:@"avatar"]; }]; -AFHTTPRequestOperation *operation = [AFHTTPRequestOperation operationWithRequest:request completion:^(NSURLRequest *request, NSHTTPURLResponse *response, NSData *data, NSError *error) { - NSLog(@"Upload Complete"); -}]; - +AFHTTPRequestOperation *operation = [[[AFHTTPRequestOperation alloc] initWithRequest:request] autorelease]; [operation setUploadProgressBlock:^(NSUInteger totalBytesWritten, NSUInteger totalBytesExpectedToWrite) { NSLog(@"Sent %d of %d bytes", totalBytesWritten, totalBytesExpectedToWrite); }];