|
@@ -530,26 +530,16 @@ public class RNFetchBlobReq extends BroadcastReceiver implements Runnable {
|
530
|
530
|
}
|
531
|
531
|
break;
|
532
|
532
|
case FileStorage:
|
533
|
|
- ResponseBody responseBody = resp.body();
|
534
|
|
-
|
535
|
533
|
try {
|
536
|
534
|
// In order to write response data to `destPath` we have to invoke this method.
|
537
|
535
|
// It uses customized response body which is able to report download progress
|
538
|
536
|
// and write response data to destination path.
|
539
|
|
- responseBody.bytes();
|
|
537
|
+ resp.body().bytes();
|
540
|
538
|
} catch (Exception ignored) {
|
541
|
539
|
// ignored.printStackTrace();
|
542
|
540
|
}
|
543
|
|
-
|
544
|
|
- RNFetchBlobFileResp rnFetchBlobFileResp = (RNFetchBlobFileResp) responseBody;
|
545
|
|
-
|
546
|
|
- if(rnFetchBlobFileResp != null && rnFetchBlobFileResp.isDownloadComplete() == false){
|
547
|
|
- callback.invoke("RNFetchBlob failed. Download interrupted.", null);
|
548
|
|
- }
|
549
|
|
- else {
|
550
|
|
- this.destPath = this.destPath.replace("?append=true", "");
|
551
|
|
- callback.invoke(null, RNFetchBlobConst.RNFB_RESPONSE_PATH, this.destPath);
|
552
|
|
- }
|
|
541
|
+ this.destPath = this.destPath.replace("?append=true", "");
|
|
542
|
+ callback.invoke(null, RNFetchBlobConst.RNFB_RESPONSE_PATH, this.destPath);
|
553
|
543
|
break;
|
554
|
544
|
default:
|
555
|
545
|
try {
|