|
@@ -322,7 +322,7 @@ If mime is null or undefined, then the mime type will be inferred from the file
|
322
|
322
|
|
323
|
323
|
**Download Notification and Visibiliy in Download App (Android Only)**
|
324
|
324
|
|
325
|
|
-If you want to download success notification or make the stored file visible like the above. You have to add some options to `config`.
|
|
325
|
+If you want to download notification or make the stored file visible like the above. You have to add some options to `config`.
|
326
|
326
|
|
327
|
327
|
```js
|
328
|
328
|
RNFetchBlob.config({
|
|
@@ -715,16 +715,29 @@ RNFetchBlob.fs.unlink(path)
|
715
|
715
|
.catch((err) => { ... })
|
716
|
716
|
```
|
717
|
717
|
|
718
|
|
-#### lstat(path:string):Promise
|
|
718
|
+#### lstat(path:string):Promise<RNFetchBlobStat>
|
719
|
719
|
|
720
|
|
-Get statistic data of a path, the result data will be an array contains objects like this :
|
|
720
|
+Get statistic data of files in a directory, the result data will be an array of [RNFetchBlobStat](#user-content-rnfetchblobstat).
|
721
|
721
|
|
722
|
|
-{
|
723
|
|
- filename : 'foo.png',
|
724
|
|
- path : '/path/to/the/file/wihout/file/name/',
|
725
|
|
- size : 4901,
|
726
|
|
- type : 'file'
|
727
|
|
-}
|
|
722
|
+```js
|
|
723
|
+RNFetchBlob.fs.lstat(PATH_OF_A_FOLDER)
|
|
724
|
+ .then((stats) => {})
|
|
725
|
+ .catch((err) => {})
|
|
726
|
+```
|
|
727
|
+
|
|
728
|
+#### stat(path:string):Promise<RNFetchBlobStat>
|
|
729
|
+
|
|
730
|
+Similar get statistic a data or a directory. the result data will be a [RNFetchBlobStat](#user-content-rnfetchblobstat).
|
|
731
|
+
|
|
732
|
+```js
|
|
733
|
+RNFetchBlob.fs.stat(PATH_OF_THE_TARGET)
|
|
734
|
+ .then((stats) => {})
|
|
735
|
+ .catch((err) => {})
|
|
736
|
+```
|
|
737
|
+
|
|
738
|
+#### scanFile(path:string):Promise (Androi Only)
|
|
739
|
+
|
|
740
|
+Connect `Media Scanner` and scan the file. see [Android Media Scanner, and Downloads App Support](#user-content-android-media-scanner-and-downloads-app-support) chapter for more information.
|
728
|
741
|
|
729
|
742
|
## Types
|
730
|
743
|
|
|
@@ -769,6 +782,25 @@ RNFetchBlob.session('session-name').add(resp.path())
|
769
|
782
|
// or
|
770
|
783
|
resp.session('session-name')
|
771
|
784
|
```
|
|
785
|
+---
|
|
786
|
+
|
|
787
|
+### RNFetchBlobStat
|
|
788
|
+
|
|
789
|
+Statistic data of a file, see the following sample object.
|
|
790
|
+
|
|
791
|
+```js
|
|
792
|
+{
|
|
793
|
+ // file name
|
|
794
|
+ filename : 'foo.png',
|
|
795
|
+ // folder of the file or the folder itself
|
|
796
|
+ path : '/path/to/the/file/wihout/file/name/',
|
|
797
|
+ // size in byte
|
|
798
|
+ size : 4901,
|
|
799
|
+ // `file` or `directory`
|
|
800
|
+ type : 'file',
|
|
801
|
+ // last modified timestamp
|
|
802
|
+ lastModified : 141323298
|
|
803
|
+}
|
772
|
804
|
|
773
|
805
|
---
|
774
|
806
|
|