Przeglądaj źródła

Merge pull request #139 from kejinliang/master

Update RNFetchBlobNetwork.m
wkh237 8 lat temu
rodzic
commit
1de74c10cc
2 zmienionych plików z 4 dodań i 2 usunięć
  1. 1
    1
      package.json
  2. 3
    1
      src/ios/RNFetchBlobNetwork.m

+ 1
- 1
package.json Wyświetl plik

@@ -1,5 +1,5 @@
1 1
 {
2
-  "name": "fetchblob-dev",
2
+  "name": "react-native-fetch-blob",
3 3
   "version": "0.9.5",
4 4
   "private": true,
5 5
   "scripts": {

+ 3
- 1
src/ios/RNFetchBlobNetwork.m Wyświetl plik

@@ -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];