Browse Source

Apply fix to #254

Ben Hsieh 7 years ago
parent
commit
edd5956517
2 changed files with 4 additions and 2 deletions
  1. 3
    1
      src/fs.js
  2. 1
    1
      src/ios/RNFetchBlobFS.m

+ 3
- 1
src/fs.js View File

201
       if(err)
201
       if(err)
202
         reject(new Error(err))
202
         reject(new Error(err))
203
       else {
203
       else {
204
-        if(stat)
204
+        if(stat) {
205
+          stat.size = parseInt(stat.size)
205
           stat.lastModified = parseInt(stat.lastModified)
206
           stat.lastModified = parseInt(stat.lastModified)
207
+        }
206
         resolve(stat)
208
         resolve(stat)
207
       }
209
       }
208
     })
210
     })

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

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