Firebase jpg tag displaying in App Inventor

Good Day all,

have managed to upload a picture to a tag in the firebase realtime database. I should now like to view it within my app.
I am reading and writing quite a few tags and have to say the firebase interface is exceptional. I just dont know how to pass that data to display the photograph. Can anybody please help.

Are you sure ? Do you mean Firebase Storage? The realtime database will only accept text entries, so unless you converted to base64....? Or you have only upload a tag with a file path ?

Show what you are doing, image of blocks, firebase structure etc.

1 Like

Yes I uploaded with base 64. I can cut and paste the base64 string into chromium and see the picture.
I would use the webviewer but it keeps putting http:// in front of the string.

Also Here is an example of my base64 string.
data:image/jpeg;base64,%2F9j%2F4AAQSkZJRgABAQEAAAAAAAD%2F2wBDAAoHCAkIBgoJCAkLCwoMDxkQDw4ODx8WFxIZJCAmJiQgIyIoLToxKCs2KyIjMkQzNjs9QEFAJzBHTEY%2FSzo%2FQD7%2F2wBDAQsLCw8NDx0QEB0%2BKSMpPj4%2BPj4%2BPj4%2BPj4%2BPj4%2BPj4%2BPj4%2BPj4%2BPj4%2BPj4%2BPj4%2BPj4%2BPj4%2BPj4%2BPj4%2BPj4%2BPj7%2FxAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv%2FxAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5%2Bjp6vHy8%2FT19vf4%2Bfr%2FxAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv%2FxAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eX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GDK%2B4%2BnWrizSFf3ESger1IxwspJ%2BZ5Wb27VajsFXoKkCdbYelKYMUwGGOopI%2BKAKUq1nzr6UxFKQYqnLVAUpKqnrQB0fn1HK24ZFAEPnimtdf3aAJ7aK5uPmx8taENg%2FR1OPYUhm1a2MAX7vNXo7NT0qQJ0tttSBcNQBJtqNxSArmoZBTEUph1rOmGKYGfNVCSqApyVUb71AF5Jql%2B0D60wGpDJO2cYFa%2BlaajfPIM0gOhjgVV4q5AntUjLqQg1PHFikBLtpNtACFaiY0AQviqj0CKU1Z9x0oAzJ6z5qoClJVR%2BtMDQt7R5j6CrotVhccUAaUNqJcela9vF5a4FAzQjXirUK8VIi6i4qzGKAHmP2phFICFqrtQBVkOKrO3WgChM1Z0ze9MChM1Z8xqgKUlVX60DOst1xUske%2BgksWJ28Vrx4NAy5GKuRVIFpaswJlhQI27ax89elUbq2EdMRlygA1RkpDKstU5TSGUpjWZOeaYFGVqoSmqApyGqz0AdlEKuKlBIqx7Gq%2FB70DNCI1dipAXoYmataztGLDIwKYG25S3teOprm76cZ60EmRM9U5GzUlFZ24qhO9AyhNJWbK1MCnKapymmBUeq7daAOziOGrRhIIoJJmFPh60DLsRq5E9IDXsbtUPNbn9rQ%2BTgLg0xGdc6juGKx559xoAqPJmqrPUjK8j1RkNAGdcNWfI1MZVlaqchpgVnNQmgDr84q7bP60EmnH92pVXDUATLwKkUkUDJxLipvP96BDHnqBpaQyF5KqzSUAVnkqlNJQBnTPVN2pgVZDVdjQBXaozTGf%2F9kAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADLuHrNlamBnymqp6Uxn%2F%2FZ

Unfortunately, the handling of data uris and other such type is broken in the webviewer, there is a fix coming in the next release of App Inventor.

Easiest thing to do is to use a base64 extension to convert the string back to a file

Alternatively, learn how to upload files to Firebase Storage, then you can use a link. You can do this without security using and extension:

or with or without security using the REST api

Firebase with a Web Component

There are other methods / extensions

1 Like

I will get right on it. Many thanks for your help it is very much appreciated. I was staggered (without Tequilla) at the speed at which I am able to build an App using this tool. It has always been my dream to see programming become this simple. Lowering the bar of entry and allowing people to focus on the problem they are solving rather than the complex programming necessary to make the solution work.

Filey did not seem to convert it back to a jpg.
What am I missing?

To display your base64 string in an image block you need these blocks

  1. UriDecode the string (you need to bring in a web component for this block)
  2. Remove the identifiers at the beginning
  3. Save to file
  4. Use the GotFile event block
  5. Add file:// to the file path / response

Works, but perhaps not the best solution ?

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.