You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 16, 2019. It is now read-only.
The simplest way is give a `fileCach` option to config, and set it to `true`. This will let the incoming response data stored in a temporary path **wihout** any file extension.
99
+
The simplest way is give a `fileCach` option to config, and set it to `true`. This will let the incoming response data stored in a temporary path **wihout** any file extension.
100
100
101
101
**These files won't be removed automatically, please refer to [Cache File Management](#user-content-cache-file-management)**
// here's the body you're going to send, should be a BASE64 encoded string
181
-
// (you can use "base64" APIs to make one).
180
+
// here's the body you're going to send, should be a BASE64 encoded string
181
+
// (you can use "base64" APIs to make one).
182
182
// The data will be converted to "byte array"(say, blob) before request sent.
183
183
}, base64ImageString)
184
184
.then((res) => {
@@ -253,7 +253,7 @@ What if you want to upload a file in some field ? Just like [upload a file from
253
253
'Content-Type':'multipart/form-data',
254
254
}, [
255
255
// append field data from file path
256
-
{
256
+
{
257
257
name :'avatar',
258
258
filename :'avatar.png',
259
259
// Change BASE64 encoded data to a file path with prefix `RNFetchBlob-file://` when the data comes from a file path
@@ -318,7 +318,7 @@ RNFetchBlob.config({
318
318
319
319
#### File Access
320
320
321
-
File access APIs were made when developing `v0.5.0`, which helping us write tests, and was not planned to be a part of this module. However I realized that, it's hard to find a great solution to manage cached files, every one who use this moudle may need those APIs for there cases.
321
+
File access APIs were made when developing `v0.5.0`, which helping us write tests, and was not planned to be a part of this module. However I realized that, it's hard to find a great solution to manage cached files, every one who use this moudle may need those APIs for there cases.
322
322
323
323
Here's the list of `fs` APIs
324
324
@@ -340,7 +340,7 @@ See [fs](#user-content-fs) chapter for more information
340
340
341
341
In `v0.5.0` we've added `writeStream` and `readStream`, which allows your app read/write data from file path. This API creates a file stream, rather than convert whole data into BASE64 encoded string, it's handy when processing **large files**.
342
342
343
-
When calling `readStream` method, you have to `open` the stream, and start to read data.
343
+
When calling `readStream` method, you have to `open` the stream, and start to read data.
344
344
345
345
```js
346
346
let data =''
@@ -372,7 +372,7 @@ When use `writeStream`, the stream is also opened immediately, but you have to `
372
372
373
373
```js
374
374
let ofstream =RNFetchBlob.writeStream(
375
-
PATH_TO_FILE,
375
+
PATH_TO_FILE,
376
376
// encoding, should be one of `base64`, `utf8`, `ascii`
377
377
'utf8',
378
378
// should data append to existing content ?
@@ -444,14 +444,18 @@ You can also group the requests by using `session` API, and use `dispose` to rem
444
444
445
445
#### `config(options:RNFetchBlobConfig):fetch`
446
446
447
+
---
448
+
447
449
`0.5.0`
448
450
449
-
Config API was introduced in `v0.5.0` which provides some options for the `fetch` task.
451
+
Config API was introduced in `v0.5.0` which provides some options for the `fetch` task.
450
452
451
453
see [RNFetchBlobConfig](#user-content-rnfetchblobconfig)
If you're going to make downloaded file visible in Android `Downloads` app, please see [Show Downloaded File and Notification in Android Downloads App](#user-content-show-downloaded-file-in-android-downloads-app).
524
+
If you're going to make downloaded file visible in Android `Downloads` app, please see [Show Downloaded File and Notification in Android Downloads App](#user-content-show-downloaded-file-and-notifiction-in-android-downloads-app).
518
525
519
526
#### createFile(path, data, encoding):Promise
520
527
@@ -544,7 +551,7 @@ Encoding of input data.
544
551
#### append:`boolean`(optional, default to `false`)
545
552
Will new data append after existing file or not.
546
553
547
-
Calling `writeStream` method will returns a Promise, which resolves a `RNFetchBlobWriteSteam` instance when stream opened successfully.
554
+
Calling `writeStream` method will returns a Promise, which resolves a `RNFetchBlobWriteSteam` instance when stream opened successfully.
0 commit comments