Fixing broken merge
This commit is contained in:
parent
b43aba49fc
commit
37524696e3
1 changed files with 19 additions and 45 deletions
|
|
@ -697,7 +697,7 @@ static NSString * AFMultipartTemporaryFileDirectoryPath() {
|
|||
|
||||
NSError *error = nil;
|
||||
if(![[NSFileManager defaultManager] createDirectoryAtPath:multipartTemporaryFilePath withIntermediateDirectories:YES attributes:nil error:&error]) {
|
||||
NSLog(@"Failed to create multipart temporary file directory at %@", multipartTemporaryFilePath);
|
||||
NSLog(@"Failed to create multipary temporary file directory at %@", multipartTemporaryFilePath);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -824,6 +824,7 @@ static inline NSString * AFContentTypeForPathExtension(NSString *extension) {
|
|||
[self.bodyStream.HTTPBodyParts addObject:bodyPart];
|
||||
}
|
||||
|
||||
|
||||
- (void)appendPartWithFileData:(NSData *)data
|
||||
name:(NSString *)name
|
||||
fileName:(NSString *)fileName
|
||||
|
|
@ -1074,44 +1075,17 @@ typedef enum {
|
|||
return self;
|
||||
}
|
||||
|
||||
- (void)appendPartWithFormData:(NSData *)data
|
||||
name:(NSString *)name
|
||||
{
|
||||
NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary];
|
||||
[mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"", name] forKey:@"Content-Disposition"];
|
||||
}
|
||||
|
||||
- (void)appendPartWithFileData:(NSData *)data
|
||||
name:(NSString *)name
|
||||
fileName:(NSString *)fileName
|
||||
mimeType:(NSString *)mimeType
|
||||
{
|
||||
NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary];
|
||||
[mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"; filename=\"%@\"", name, fileName] forKey:@"Content-Disposition"];
|
||||
[mutableHeaders setValue:mimeType forKey:@"Content-Type"];
|
||||
- (void)dealloc {
|
||||
if (_inputStream) {
|
||||
[_inputStream close];
|
||||
_inputStream = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)transitionToNextPhase {
|
||||
if (![[NSThread currentThread] isMainThread]) {
|
||||
[self performSelectorOnMainThread:@selector(transitionToNextPhase) withObject:nil waitUntilDone:YES];
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)appendPartWithFileURL:(NSURL *)fileURL
|
||||
name:(NSString *)name
|
||||
error:(NSError **)error
|
||||
{
|
||||
if (![fileURL isFileURL]) {
|
||||
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
|
||||
[userInfo setValue:fileURL forKey:NSURLErrorFailingURLErrorKey];
|
||||
[userInfo setValue:NSLocalizedString(@"Expected URL to be a file URL", nil) forKey:NSLocalizedFailureReasonErrorKey];
|
||||
if (error != NULL) {
|
||||
*error = [[NSError alloc] initWithDomain:NSURLErrorDomain code:NSURLErrorBadURL userInfo:userInfo];
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
switch (_phase) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue