User uploads photos and it gets stored in the stored variable. When the user installs a new version of the app, the stored variables are maintained but the photos are all missing for the user. Is there a solution to maintain user uploaded photos in the stored variables even if user re-installs a new version of the app without uploading the user’s photos to the cloud? Most of my use cases are offline so I’m looking for a way to keep the photos without uploading to Cloudinary.
What do your words mean when you say that a user uploads photos? How and where are these photos downloaded and where are they stored? You can save paths to photos, but you need to use additional functionality to get the contents of the files. So the question is, do you keep links to photos or their contents?
Are you sure that when you install a new version of the application, the data in the stored variables is saved?
The user can upload the photo from his/her mobile phone using the Camera or PhotoLibrary component which then gets stored in a stored variable. The data in the stored variable gets is maintained when a new version of the app is installed including the path of the photo but the photo doesn’t exist anymore in that path.
Are there other ways to store photos locally that won’t be deleted when a new version gets installed?
Of course, photos will not be on the specified path, because this is a temporary path. There is no simple solution to your problem, but this option is possible: you upload a photo from the Camera or Gallery, then send it to Cloudinary, and then send the link received from Cloudinary to Web Api, which returns the contents of the file in base64 format. You can save this data in the storevd variable.
If you are satisfied with this method, I can tell you more.
Gotcha. I’m looking at base64 API converters. Looks like that’s my best option right now. I would need to convert the image to a smaller PNG first (so it won’t impact performance of the app) then convert it to Base64. Do you have a recommended Base64 API converter and some samples?