hey guys,i am using firebase and i try to upload a picture using their 
method upload from a local file.

UploadTask uploadTask = currentPicRef.putFile(file, metadata);

When the user pick's image from the gallery or taking a picture via the 
camera the picture is saved in external storage and I save the uri in 
shared preference.

I successfully loaded the image into an imageview using the 
setImageURI(uri) method, but When I call the firebase method and using the 
same uri (Uri file = Uri.fromFile(new File(fileName));)
I get the error

"could not locate file for 
uploading:file:///content%3A/media/external/images/media/22943"

but when I use log to check the local file I get

"uri is content://media/external/images/media/22943"

also worth to mention that when I used uri.parse() instead uri.fromFile() 
in firebase to upload from a local file it uploaded the metadata but not 
the photo itself.

Any ideas how to fix it?


-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/7d718463-483a-44d6-85f7-6c02b9be3b04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to