I would like to put a simple jpg in the firebase storage. I can return a file ok but not to push a simple file. I use an android emulator for my test.
my function
const uri = http://...:8081/assets/src/assets/images.jpg?platform=android&hash=131a57e2363da7e4dada04c4f2d34f85
return new Promise((resolve, reject) => {
storage()
.ref('/images/test.jpg')
.putFile(uri )
.then((snapshot) => {
console.log('test.jpg has been successfully uploaded.');
resolve()
})
.catch((e) => {
console.log('uploading image error => ', e)
reject()
});
})
my error
Error: [storage/unknown] No content provider: http://....:8081/assets/src/assets/images.jpg?platform=android&hash=131a57e2363da7e4dada04c4f2d34f85
You can upload files to Cloud Storage from Firebase from three types of sources:
What you are trying to do is upload data from a URL, which is not one of the supported options. If you want to store the image from that URL in Firebase, you will have to download the data from the URL to your local device, and then upload it from there.