aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/mac/HTTPMultipartUpload.m16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/common/mac/HTTPMultipartUpload.m b/src/common/mac/HTTPMultipartUpload.m
index 76f38f8a..bd88cffa 100644
--- a/src/common/mac/HTTPMultipartUpload.m
+++ b/src/common/mac/HTTPMultipartUpload.m
@@ -143,7 +143,7 @@
//=============================================================================
- (NSData *)send:(NSError **)error {
- NSMutableURLRequest *req =
+ NSMutableURLRequest *req =
[[NSMutableURLRequest alloc]
initWithURL:url_ cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0 ];
@@ -190,12 +190,16 @@
[response_ release];
response_ = nil;
-
- NSData *data = [NSURLConnection sendSynchronousRequest:req
- returningResponse:&response_
- error:error];
- [response_ retain];
+ NSData *data;
+ if ([[req URL] isFileURL]) {
+ [[req HTTPBody] writeToURL:[req URL] options:0 error:error];
+ } else {
+ data = [NSURLConnection sendSynchronousRequest:req
+ returningResponse:&response_
+ error:error];
+ [response_ retain];
+ }
[req release];
return data;