How to integrate FileSystem with ImagePicker?


#1

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.
Link: https://docs.expo.io/versions/latest/sdk/filesystem.html

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


#2

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: https://github.com/sameesiddiqui/expo-file-system-view


#3

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.


#4

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


#5

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


#6

This was the first result on Googling this topic: https://github.com/aaronksaunders/expo-rn-firebase-image-upload


#7

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 ?