Comments (7)
Hi @vaibhawc , thank you for your information! Looks like the progress report mechanism is broken since I change the HTTP implementation. I'll fix this issue.
from react-native-fetch-blob.
@vaibhawc , thank you for your assistance, this issue has been solved in 1b2d9a7 and will be included in next release 0.6.1
, I'll publish this version after doing some more tests on Android.
from react-native-fetch-blob.
Thank you @wkh237 , that was very quick and sincere. I am actually trying to send an image where I need to know progress as well handle cancel and resume. I haven't tried it yet, but will have to handle it by my own. It might be a good idea to consider such options like onCancel, onResume. Basically they are inspired by the firebase-storage-api. Or may be I should put it on separate thread.
from react-native-fetch-blob.
Hi @vaibhawc , thank you for your suggestion and feedback, I've published a new version 0.6.1
on npm
, please re-install the package and see if that fulfills your use case. You're welcome to leave a comment here if there's any question : ) As for the onResume
and onCancel
options, I think those are very important features that I'm considering to add them into this module 👍
from react-native-fetch-blob.
Hi @wkh237 ,It works well, thank you. RNFB is an amazing problem solver for me.
But there are so many functionalities not provided in RN that might be provided by libraries like this in future. One such functionality, which I don't require, but found out while trying firebase-storage, is that FBStorage requires blob to be passed to its API's 'put()' method which essentially means I can't use RN anyhow (afaik) for FBStorage. https://firebase.google.com/docs/reference/js/firebase.storage.Reference#put
May be somebody might require it, or may be firebase may provide some alternative to it in future.
As of now, I don't have enough know-how to make one all myself or on top of RNFB (I'd love to).
If you find time, do try it out. :)
I am closing this one here, Thank you for your support. 👍
from react-native-fetch-blob.
@vaibhawc , I'm greatly appreciate your thoughtful comments that helped improve the module. Thought we can not use FireBase web SDK directly, I suppose it is possible to use its REST API alternatively. I'm not familiar with FireBase, but I'll take some time and give it a try. 👍
from react-native-fetch-blob.
RNFetchBlob.config({
path:`${dirs.DownloadDir}/${filename}`,
fileCache:false
// addAndroidDownloads: {
// notification : true,
// useDownloadManager : true,
// description: 'TaxiJo Payment Invoice',
// mime:'application/pdf',
// mediaScannable:true,
// path:`${dirs.DownloadDir}/${filename}`
// },
})
.fetch('GET',this.state.invoiceUrl,{
'Cache-Control' : 'no-store'
})
.progress({ interval: 250 },(received,total)=>{
console.log('progress',received/total);
this.setState({
downloadProgress:(received/total)*100
})
})
.then(res=>{
// RNFetchBlob.fs.stat(res.path()).then(stats=>{
// console.log(stats);
// }).catch(err=>{
// console.log('error while getting mimetypes');
// })
this.setState({
downloadProgress:0
})
// RNFetchBlob.fs.exists(res.path()).then(exist=>{
// console.log(`file ${exist ? '' : 'not'} exists`)
// }).catch(
// err=>console.log('error while checking existance',err)
// );
if(Platform.OS === 'ios'){
RNFetchBlob.ios.openDocument(res.path());
}else{
RNFetchBlob.android.actionViewIntent(res.path(),"application/pdf");
}
})
.catch((errorMessage,statusCode)=>{
console.log("error with downloading file",errorMessage)
})
from react-native-fetch-blob.
Related Issues (20)
- Error calling RCTDeviceEventEmitter.emit failed to create value from json HOT 3
- react-native-fetch-blob has memory leak during update download progress
- Multiple dex files define Lcom/RNFetchBlob/RNFetchBlobConst; HOT 2
- Could not store file in a specified path HOT 1
- New format of IOS 11 files (HEIF and HEVC) are giving error when uploading
- Invalid value for visibility : 2 HOT 3
- Native module BlobModule is required for blob support HOT 1
- react-native-fetch-blob image upload failed for android(always receives zero bytes)
- Save file to internal storage HOT 4
- Execution failed for task ':react-native-fetch-blob:verifyReleaseResources'. HOT 3
- Does anybody have good example for base64 encoding and decoding for video and image?
- Build is failing due to jcenter dependency disappearing HOT 4
- Cannot download run background in iOS
- Cannot fetch jpeg image multipart/form-data.
- RNFetchBlob blocked firebase/firestore call react native HOT 1
- iOS build failed xcode 10
- android.actionViewIntent not working
- skip some bytes of file in Multipart form-data
- joltup/rn-fetch-blob is absolute SHIT
- RNFetchBlob.fetchBlobForm failed to create request body - Issue happens intermediately HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-fetch-blob.