Cannot use media object stored in table with iFrame?

I have an Altair graph stored in a media object that I want to show with the Iframe component (see Altair example on Anvil site).
I’d expect this to work:

        media = report['media']
        self.iframe_report.url = media.get_url(True)

It doesn’t; instead of showing the contents of the media object in the Iframe it will download the file.

Changing to this

        media = report['media']
        media = anvil.BlobMedia('text/html', media.get_bytes() )
        self.iframe_report.url = media.get_url(True)

fixes the problem.

Why the difference between the table media and the blob media?

Hi @mjmare, thanks for letting us know.

This is a bug, moving to Bug Reports!