How to integrate FileSystem with ImagePicker?

Hello … I found this in the “FileSystem” section in the documentation :

Expo APIs that create files generally operate within these directories. This includes Audio recordings, Camera photos, ImagePicker results, SQLite databases and takeSnapShotAsync() results. This allows their use with the FileSystem API.

is there an example to show how to integrate FileSystem with ImagePicker ?

hey, do you mean where to access a file that you select with image picker? it will get saved under FileSystem.cacheDirectory. you can then reference the image from the uri parameter of the object that the function returns

if you want to save it in a specific folder, I don’t believe that functionality exists right now so you can copy the image from the cache to your desired location.

heres a expo filesystem viewer you can use for debugging during development:

1 Like

Hey Samee … Thanks for your reply. I just was hoping that I could reference the image that I have picked as a file that I can upload to Firebase cloud storage. Bur apparently I keep hitting an uri every time instead.

could you explain what you mean? the uri should be able to be used as a reference

Firebase requires a File object not just a uri in order to upload the image. So I was hoping FileSystem would get me a File object out of imagePicker

This was the first result on Googling this topic:

Hello nikki. I pretty much thank you for your effort googling this. I tried this before and it didn’t work for me. I think if it does, expo team would mention it in the documents, wouldn’t they ?