Read files ios thunkable

Good morning, I have a problem with thunkable ios.
I have to read the contents of a file that I have attached in the files section and I do not know how to do it. Is there an instruction in the blocks part that allows me?

If it is an image file, its contents can be read via WebViewer in base64 format, if you attach it to the tag. But it is not easy to do.

thank you so much

Note that if it is an image file, you could just use name of the file (as it is shown in the files list) as the Picture property of an Image component. See here for documentation details.

For many other types of file you should be able to just use the name of the file as the URL for the Web Viewer. See here.

-Mark

1 Like

Hi Mark, I want to know can image data from image component save to localstorage? or localstorage only save text of image file name/url?

I see cache property in image component, is cache function implemented? I want to make offline feature for my app. Thanks.

Hi,

You can save images to Local Storage in the format of base64.

@yanito, How are you obtaining the image data? Is it from one of the names in your local files list or is it via some remote URL?

-Mark

via remote URL like web api or airtable attachment.

@yanito, I’m afraid that we don’t currently support saving remote image data to Local Storage. As @actech points out, there might be some complicated workarounds but, as he says, it’s pretty difficult to do and might not always work.

-Mark

@Mark thank you for answer, I will try @actech base64 solution, but it only work with image or api I control, not 3rd party web api. thanks.