Fixing file upload to match 0.7 API (Thanks, @Hunter)

This commit is contained in:
Mattt Thompson 2011-10-13 13:29:14 -05:00
parent b811dc1e94
commit 73e1137649

View file

@ -66,10 +66,7 @@ NSMutableURLRequest *request = [[AFHTTPClient sharedClient] multipartFormRequest
[formData appendPartWithFileData:data mimeType:@"image/jpeg" name:@"avatar"]; [formData appendPartWithFileData:data mimeType:@"image/jpeg" name:@"avatar"];
}]; }];
AFHTTPRequestOperation *operation = [AFHTTPRequestOperation operationWithRequest:request completion:^(NSURLRequest *request, NSHTTPURLResponse *response, NSData *data, NSError *error) { AFHTTPRequestOperation *operation = [[[AFHTTPRequestOperation alloc] initWithRequest:request] autorelease];
NSLog(@"Upload Complete");
}];
[operation setUploadProgressBlock:^(NSUInteger totalBytesWritten, NSUInteger totalBytesExpectedToWrite) { [operation setUploadProgressBlock:^(NSUInteger totalBytesWritten, NSUInteger totalBytesExpectedToWrite) {
NSLog(@"Sent %d of %d bytes", totalBytesWritten, totalBytesExpectedToWrite); NSLog(@"Sent %d of %d bytes", totalBytesWritten, totalBytesExpectedToWrite);
}]; }];