1

In my application i save a batch of images locally using the Expo FileSystem and storing their fully uri in redux (file://......). I transform the image to base64 and store this in the document directory, as a file, whenever an image is taken. When the user uploads the batch of images to firebase I utilze the uploadBytes function, thus converting the base64 file to bytes. However, when I update the app through Testflight or App Store I am not able to view or upload images that already have been taken. Is this because the Document directory path is modified upon update?

Docs for filesystem: https://docs.expo.dev/versions/latest/sdk/filesystem/

jorho
  • 49
  • 2
  • 7

2 Answers2

3

Fixed: Seems like updating the app does change the file path. Therefore, it was solved by first fetching the relative document path and appending the desired file e.g FileSystem.documentDirectory + ${nameOfFile}

jorho
  • 49
  • 2
  • 7
0

@jorho's answer is correct but it took me a few minutes to click and I didn't recognise it at first so I thought I'd add an answer for anyone scrolling down.

I was thinking of this from the point of view of a "traditional" filesystem. That's not how this is working. What's happening here is that even though the path is changing, it still refers to the original file.

What?

I know right? The key here is to understand that although the "old" absolute path no longer works, the "new" absolute path does refer to your file.

Counterintuitively, using a different path (i.e. prepending the changed DocumentDirectory) Will access the existing stored file as intended.

David Carboni
  • 1,556
  • 23
  • 24