Convert image path to blob react native

后端 未结 4 1955
隐瞒了意图╮
隐瞒了意图╮ 2021-02-19 04:21

Problem

I am trying to create an app with react native and firebase. One of the features I would like for this app is the ability to upload images. I

4条回答
  •  时光取名叫无心
    2021-02-19 05:10

    Not sure whom this might help, but if you're using MediaLibrary to load images from the gallery, then the uri comes in the format of uri = file:///storage/emulated/0/DCIM/Camera/filename.jpg

    In this case, using fetch(uri) didn't help me get the blob.

    But if you use fetch(uri.replace("file:///","file:/")) and then follow @sriteja Sugoor's answer, you'll be able to upload the file blob.

提交回复
热议问题