Ben Hsieh 7 anni fa
parent
commit
edd5956517
2 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  1. 3
    1
      src/fs.js
  2. 1
    1
      src/ios/RNFetchBlobFS.m

+ 3
- 1
src/fs.js Vedi File

@@ -201,8 +201,10 @@ function stat(path:string):Promise<RNFetchBlobFile> {
201 201
       if(err)
202 202
         reject(new Error(err))
203 203
       else {
204
-        if(stat)
204
+        if(stat) {
205
+          stat.size = parseInt(stat.size)
205 206
           stat.lastModified = parseInt(stat.lastModified)
207
+        }
206 208
         resolve(stat)
207 209
       }
208 210
     })

+ 1
- 1
src/ios/RNFetchBlobFS.m Vedi File

@@ -516,7 +516,7 @@ NSMutableDictionary *fileStreams = nil;
516 516
              @"size" : size,
517 517
              @"filename" : filename,
518 518
              @"path" : path,
519
-             @"lastModified" : [NSNumber numberWithLong:(time_t) [lastModified timeIntervalSince1970]*1000],
519
+             @"lastModified" : [NSString stringWithFormat:@"%@", [NSNumber numberWithLong:(time_t) [lastModified timeIntervalSince1970]*1000]],
520 520
              @"type" : isDir ? @"directory" : @"file"
521 521
             };
522 522