Browse Source

Update RNFetchBlobNetwork.m

kejinliang 7 years ago
parent
commit
365c941cd3
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      src/ios/RNFetchBlobNetwork.m

+ 3
- 1
src/ios/RNFetchBlobNetwork.m View File

@@ -285,7 +285,9 @@ NSOperationQueue *taskQueue;
285 285
             if(![fm fileExistsAtPath:folder]) {
286 286
                 [fm createDirectoryAtPath:folder withIntermediateDirectories:YES attributes:NULL error:nil];
287 287
             }
288
-            [fm createFileAtPath:destPath contents:[[NSData alloc] init] attributes:nil];
288
+            if (![fm fileExistsAtPath:destPath]) {
289
+                [fm createFileAtPath:destPath contents:[[NSData alloc] init] attributes:nil];
290
+            }
289 291
             writeStream = [[NSOutputStream alloc] initToFileAtPath:destPath append:YES];
290 292
             [writeStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
291 293
             [writeStream open];