I am using image picker for picking image from my phone .image picker provide the response
{height: 33, origURL: "assets-library://asset/asset.JPG?id=9F983DBA-EC35-42B8-8773-B597CF782EDD&ext=JPG", longitude: -17.54892833333333, fileName: "IMG_0003.JPG", uri: "file:///Users/mac/Library/Developer/CoreSimulator/…temfiles/ADC7B1EA-93A0-4A25-B7CA-342BE3EF58BE.jpg", …}
I am using RNFetchBlob for uploading image to firebase. actually i want to upload image using either data or uri not using origURL because i need to reduce the image size before uploading.Currently uploading is not possible using uri
let rnfbURI = RNFetchBlob.wrap(image.uri)
Blob
.build(rnfbURI, { type : 'image/png;'})
.then((blob) => {
// upload image using Firebase SDK
firebase.storage()
.ref()
.child('images/')
.put(blob, { contentType : 'image/jpg' })
.then((snapshot) => {
}).catch((error) => {
console.log(error);
Alert.alert(error);
})
});