Created
October 23, 2015 02:40
-
-
Save anonymous/fc93fac5ebed80d3fb73 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSMutableURLRequest *request = [httpClient multipartFormRequestWithMethod:@"POST" path:@"csv_files" parameters:nil constructingBodyWithBlock: ^(id <AFMultipartFormData>formData) { | |
[formData appendPartWithFileData:data name:[NSString stringWithFormat:@"KegCop-users-%@.csv",idfv] fileName:[NSString stringWithFormat:@"KegCop-users-%@.csv",idfv] mimeType:@"text/csv"]; | |
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; | |
[operation setUploadProgressBlock:^(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) { | |
NSLog(@"Sent %lld of %lld bytes", totalBytesWritten, totalBytesExpectedToWrite); | |
}]; | |
[httpClient enqueueHTTPRequestOperation:operation]; | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment