Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

How to catch something when downloading is interruppted? #264

Open
@liuxiaoy

Description

@liuxiaoy
    let task = RNFetchBlob.config({
        path : path
    }).fetch('POST', url, {
        'Content-Type': 'octet-stream'
    });
    task.progress(progressCallback);// listen to download progress event
    task.then((response) => {
        if (response.respInfo.status >= 200 && response.respInfo.status < 300) {
            callback(null, response.path());
        } else
            callback({error: 'fail', message: 'Server Exception ' + response.respInfo.status || ''});
    }).catch(e => {
        console.log(e);
        callback({error: 'fail', message: '当前网络无法访问'});
    });

when the downloading task is interruppted or canceled,it will run to " callback(null, response.path());" always.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions