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.
Copy file name to clipboardExpand all lines: README.md
+23-1Lines changed: 23 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -320,13 +320,18 @@ What if you want to upload a file in some field ? Just like [upload a file from
320
320
321
321
#### Upload/Download progress
322
322
323
-
In `version >= 0.4.2` it is possible to know the upload/download progress. On Android, only download progress is supported. See [wiki](https://github.com/wkh237/react-native-fetch-blob/wiki/Fetch-API#fetchprogresseventlistenerpromisernfetchblobresponse) for more information.
323
+
In `version >= 0.4.2` it is possible to know the upload/download progress. After `0.7.0` IOS and Android upload progress are supported.
@@ -338,6 +343,23 @@ In `version >= 0.4.2` it is possible to know the upload/download progress. On An
338
343
})
339
344
```
340
345
346
+
#### Cancel Request
347
+
348
+
After `0.7.0` it is possible to cancel a HTTP request. When the request cancel, it will definately throws an promise rejection, be sure to catch it.
349
+
350
+
```js
351
+
let task =RNFetchBlob.fetch('GET', 'http://example.com/file/1')
352
+
353
+
task.then(() => { ... })
354
+
// handle request cancelled rejection
355
+
.catch((err) => {
356
+
console.log(err)
357
+
})
358
+
// cancel the request, the callback function is optional
359
+
task.cancel((err) => { ... })
360
+
361
+
```
362
+
341
363
#### Android Media Scanner, and Download Manager Support
342
364
343
365
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`.
0 commit comments