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
 {
1
 {
2
-  "name": "fetchblob-dev",
2
+  "name": "react-native-fetch-blob",
3
   "version": "0.9.5",
3
   "version": "0.9.5",
4
   "private": true,
4
   "private": true,
5
   "scripts": {
5
   "scripts": {

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

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