react-native-fs 在接收进度的时候,已经下载的进度经常比之前的还小



  • 展示的时候就会出现进度往前移动的情况
    "react": "16.0.0",
    "react-native": "0.51.0",
    "react-native-fs": "^2.9.2",
    code:
    var download = RNFS.downloadFile({
    fromUrl:missionobj.url,
    toFile:filepath,
    progress:this.progress,
    progressDivider:1,
    });
    progress(data){
    let jobid = data.jobId;
    console.log("bytesWritten:" + data.bytesWritten + "contentLength:"+data.contentLength);
    }

    log:
    index.bundle:79400 bytesWritten:46300715contentLength:120251353
    index.bundle:79400 bytesWritten:36683307contentLength:120251353
    index.bundle:79400 bytesWritten:48709123contentLength:120251353
    index.bundle:79400 bytesWritten:41492011contentLength:120251353
    index.bundle:79400 bytesWritten:37879299contentLength:120251353
    index.bundle:79400 bytesWritten:40287747contentLength:120251353
    index.bundle:79400 bytesWritten:45096451contentLength:120251353
    index.bundle:79400 bytesWritten:43892267contentLength:120251353
    index.bundle:79400 bytesWritten:45096451contentLength:120251353
    index.bundle:79400 bytesWritten:54722051contentLength:120251353

    有人遇到过这种问题吗?


Log in to reply