|
1 |
| -# react-native-fetch-blob [](https://badge.fury.io/js/react-native-fetch-blob?style=flat-square)  |
2 |
| - |
3 |
| -# v0.6.0 WIP README.md |
| 1 | +# react-native-fetch-blob [](https://badge.fury.io/js/react-native-fetch-blob)   |
4 | 2 |
|
5 | 3 | A module provides upload, download, and files access API. Supports file stream read/write for process large files.
|
6 | 4 |
|
@@ -28,6 +26,7 @@ This update is `backward-compatible` generally you don't have to change existing
|
28 | 26 | * [File access](#user-content-file-access)
|
29 | 27 | * [File stream](#user-content-file-stream)
|
30 | 28 | * [Manage cached files](#user-content-manage-cached-files)
|
| 29 | + * [Self-Signed SSL Server](#user-content-selfsigned-ssl-server) |
31 | 30 | * [API](#user-content-api)
|
32 | 31 | * [config](#user-content-configoptionsrnfetchblobconfigfetch)
|
33 | 32 | * [fetch](#user-content-fetchmethod-url-headers-bodypromisefetchblobresponse)
|
@@ -305,7 +304,7 @@ In `version >= 0.4.2` it is possible to know the upload/download progress.
|
305 | 304 |
|
306 | 305 | #### Android Media Scanner, and Download Manager Support
|
307 | 306 |
|
308 |
| -If you want to make a file in `External Storage` becomes visible in Picture, Downloads, or other built-in apps, you will have to use `Media Scanner` or `Download Manager`. |
| 307 | +If you want to make a file in `External Storage` becomes visible in Picture, Downloads, or other built-in apps, you will have to use `Media Scanner` or `Download Manager`. |
309 | 308 |
|
310 | 309 | **Media Scanner**
|
311 | 310 |
|
@@ -336,12 +335,12 @@ When download large files on Android it is recommended to use `Download Manager`
|
336 | 335 | RNFetchBlob
|
337 | 336 | .config({
|
338 | 337 | // Optional, if not specified, the file will download to system default path
|
339 |
| - path : DOWNLOAD_DEST, |
| 338 | + path : DOWNLOAD_DEST, |
340 | 339 | addAdnroidDownloads : {
|
341 | 340 | useDownloadManager : true, // <-- this is the only thing required
|
342 | 341 | // Optional, override notification setting (default to true)
|
343 | 342 | notification : false,
|
344 |
| - // Optional, but recommended since android DownloadManager will fail when |
| 343 | + // Optional, but recommended since android DownloadManager will fail when |
345 | 344 | // the url does not contains a file extension, by default the mime type will be text/plain
|
346 | 345 | mime : 'text/plain',
|
347 | 346 | description : 'File downloaded by download manager.'
|
@@ -508,6 +507,20 @@ You can also grouping requests by using `session` API, and use `dispose` to remo
|
508 | 507 |
|
509 | 508 | ```
|
510 | 509 |
|
| 510 | +#### Self-Signed SSL Server |
| 511 | + |
| 512 | +By default, react-native-fetch-blob does NOT allow connection to unknown certification provider since it's dangerous. If you're going to connect a server with self-signed certification, add `trusty` to `config`. This function is available for version >= `0.5.3` |
| 513 | + |
| 514 | +```js |
| 515 | +RNFetchBlob.config({ |
| 516 | + trusty : true |
| 517 | +}) |
| 518 | +.then('GET', 'https://mysite.com') |
| 519 | +.then((resp) => { |
| 520 | + // ... |
| 521 | +}) |
| 522 | +``` |
| 523 | + |
511 | 524 | ---
|
512 | 525 |
|
513 | 526 | ## API
|
@@ -783,10 +796,14 @@ Connect `Media Scanner` and scan the file. see [Android Media Scanner, and Downl
|
783 | 796 |
|
784 | 797 | A set of configurations that will be injected into a `fetch` method, with the following properties.
|
785 | 798 |
|
| 799 | +#### trusty:boolean |
| 800 | + `0.5.3` |
| 801 | + Set this property to `true` will allow the request create connection with server have self-signed SSL certification. This is not recommended to use in production. |
| 802 | + |
786 | 803 | #### fileCache:boolean
|
787 | 804 | Set this property to `true` will makes response data of the `fetch` stored in a temp file, by default the temp file will stored in App's own root folder with file name template `RNFetchBlob_tmp${timestamp}`.
|
788 | 805 | #### appendExt:string
|
789 |
| - Set this propery to change temp file extension that created by `fetch` response data. |
| 806 | + Set this property to change temp file extension that created by `fetch` response data. |
790 | 807 | #### path:string
|
791 | 808 | When this property has value, `fetch` API will try to store response data in the path ignoring `fileCache` and `appendExt` property.
|
792 | 809 | #### addAndroidDownloads:object (Android only)
|
@@ -854,6 +871,7 @@ A `session` is an object that helps you manage files. It simply maintains a list
|
854 | 871 |
|
855 | 872 | | Version | |
|
856 | 873 | |---|---|
|
| 874 | +| 0.5.3 | Add API for access untrusted SSL server | |
857 | 875 | | 0.5.2 | Fix improper url params bug [#26](https://github.com/wkh237/react-native-fetch-blob/issues/26) and change IOS HTTP implementation from NSURLConnection to NSURLSession |
|
858 | 876 | | 0.5.0 | Upload/download with direct access to file storage, and also added file access APIs |
|
859 | 877 | | 0.4.2 | Supports upload/download progress |
|
|
0 commit comments