You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2013/01/02 22:41:48 UTC

ios commit: [CB-2095] Delete incomplete file on filetransfer.abort

Updated Branches:
  refs/heads/master 8ed848b42 -> 8b59a6ca3


[CB-2095] Delete incomplete file on filetransfer.abort


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

Branch: refs/heads/master
Commit: 8b59a6ca340fb1f52f032faf7de3c50aed9ede36
Parents: 8ed848b
Author: Cory Thompson <co...@gmail.com>
Authored: Fri Dec 21 11:29:52 2012 +1100
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Wed Jan 2 13:41:17 2013 -0800

----------------------------------------------------------------------
 CordovaLib/Classes/CDVFileTransfer.m |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8b59a6ca/CordovaLib/Classes/CDVFileTransfer.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVFileTransfer.m b/CordovaLib/Classes/CDVFileTransfer.m
index ee42c6b..b25177a 100644
--- a/CordovaLib/Classes/CDVFileTransfer.m
+++ b/CordovaLib/Classes/CDVFileTransfer.m
@@ -302,6 +302,10 @@ static CFIndex WriteDataToStream(NSData* data, CFWriteStreamRef stream)
     if (delegate != nil) {
         [delegate.connection cancel];
         [activeTransfers removeObjectForKey:objectId];
+        
+        //delete uncomplete file    
+        NSFileManager *fileMgr = [NSFileManager defaultManager];
+        [fileMgr removeItemAtPath:delegate.target error:nil];
 
         CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[self createFileTransferError:CONNECTION_ABORTED AndSource:delegate.source AndTarget:delegate.target]];
         [self.commandDelegate sendPluginResult:result callbackId:delegate.callbackId];