GitLiveApp / firebase-kotlin-sdk

A Kotlin-first SDK for Firebase
https://gitliveapp.github.io/firebase-kotlin-sdk/
Apache License 2.0
976 stars 148 forks source link

How to upload files to Firebase Storage? #522

Open KhubaibKhan4 opened 3 weeks ago

KhubaibKhan4 commented 3 weeks ago

I wanna upload files to firebase but unable to because It requires the File to upload not the byte array, If i try to convert that using java.io in the android & ios code as well but I'm unable to provide me way.

BasBuijsen commented 2 weeks ago

Currently only uploading of files from urls is covered. On the Android side you have a constructor for File that needs a URI to a local file. On the iOS side there is a constructor for File that needs a NSURL to a local file.

However i am currently working on adding metadata to uploading files and that pr will also include uploading data directly (i need it for testing purposes). This will have a constructor on Android with a ByteArray and on iOS with NSData. I am currently working on it so it is not in the PR yet but it will come soon.

KhubaibKhan4 commented 2 weeks ago

That's great. Looking forward to it.

BasBuijsen commented 1 week ago

It is merged now so in the next version this should be available 🎉