incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject [3/3] ios commit: Fixed CB-236 - Add ContentLength Header in Upload request
Date Mon, 12 Mar 2012 22:57:51 GMT
Fixed CB-236 - Add ContentLength Header in Upload request


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/9a94dde4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/9a94dde4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/9a94dde4

Branch: refs/heads/master
Commit: 9a94dde46348ffdad231e46e4008f90a999511e2
Parents: f47a9a0
Author: Shazron Abdullah <shazron@apache.org>
Authored: Mon Mar 12 14:40:31 2012 -0700
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Mon Mar 12 14:40:31 2012 -0700

----------------------------------------------------------------------
 CordovaLib/Classes/CDVFileTransfer.m |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/9a94dde4/CordovaLib/Classes/CDVFileTransfer.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVFileTransfer.m b/CordovaLib/Classes/CDVFileTransfer.m
index 499bd47..7d15da8 100644
--- a/CordovaLib/Classes/CDVFileTransfer.m
+++ b/CordovaLib/Classes/CDVFileTransfer.m
@@ -19,7 +19,7 @@
 
 #import "CDVFileTransfer.h"
 #import "CDVFile.h"
-
+#import "CDVDebug.h"
 
 @implementation CDVFileTransfer
 
@@ -132,7 +132,9 @@
 	[postBody appendData:[[NSString stringWithFormat:@"--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
 	[postBody appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\";
filename=\"%@\"\r\n", fileKey, fileName] dataUsingEncoding:NSUTF8StringEncoding]];
     [postBody appendData:[[NSString stringWithFormat:@"Content-Type: %@\r\n\r\n", mimeType]
dataUsingEncoding:NSUTF8StringEncoding]];
-    NSLog(@"fileData length: %d", [fileData length]);
+    [postBody appendData:[[NSString stringWithFormat:@"Content-Length: %d\r\n\r\n", [fileData
length]] dataUsingEncoding:NSUTF8StringEncoding]];
+
+    DLog(@"fileData length: %d", [fileData length]);
 	[postBody appendData:fileData];
 	[postBody appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
     
@@ -151,7 +153,7 @@
 }
 
 - (void) download:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options {
-    NSLog(@"File Transfer downloading file...");
+    DLog(@"File Transfer downloading file...");
     
     [self performSelectorInBackground:@selector(downloadFile:) withObject:arguments];
 }
@@ -165,7 +167,7 @@
     NSData* data = [NSData dataWithContentsOfURL: [NSURL URLWithString:sourceUrl] ];
     NSArray * results = nil;
     
-    NSLog(@"Write file %@", filePath);
+    DLog(@"Write file %@", filePath);
     NSError *error=[[[NSError alloc]init] autorelease];
     
     @try {
@@ -202,7 +204,7 @@
 
     BOOL bDirRequest = NO;
 
-    NSLog(@"File Transfert Download success");
+    DLog(@"File Transfer Download success");
     
     CDVFile * file = [[[CDVFile alloc] init] autorelease];
     


Mime
View raw message