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
             if(![fm fileExistsAtPath:folder]) {
285
             if(![fm fileExistsAtPath:folder]) {
286
                 [fm createDirectoryAtPath:folder withIntermediateDirectories:YES attributes:NULL error:nil];
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
             writeStream = [[NSOutputStream alloc] initToFileAtPath:destPath append:YES];
291
             writeStream = [[NSOutputStream alloc] initToFileAtPath:destPath append:YES];
290
             [writeStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
292
             [writeStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
291
             [writeStream open];
293
             [writeStream open];