[Update] externally-hosted HTML file downloading, rather than showing in iframe

Hey! I first asked about this a year ago it seems, and 12 months later, I’m still having the same problem.

Here’s the old thread: HTML file not rendering (showing source code) after upload:

The issue seems to be the way bubble is saving HTML files since an update (somewhere before Aug 23!)

I basically want to upload, then display an HTML file in a bubble page, but when I upload it, it’s rendering as plain text rather than a webpage.

When I upload the file and save it to the database, if I view it from file manager, it shows source code, not the rendered page

The success team is great at troubleshooting this type of stuff. Have you tried connecting with them?

1 Like

Are you calling the html out of your database and dynamically displaying it in an html element on your page? It seems that would force Bubble to display the rendered output and not the code?

Maybe you are and I didn’t understand your comment.

Seems that would be the best approach to get around the way Bubble handles things.

1 Like

do you mean Bubble’s support team? I have tried them in the past and got no answer at all, but if they’ve improved I’ll give it a go :slight_smile: thanks!

Thanks for responding, @senecadatabase :slight_smile:

That’s right - in an iframe. Strangely, it worked, and then there seemed to be a change to how bubble stored the files, and it didn’t work any longer. Below are two links: pre- and post- the change. You’ll see the URL is different in terms of where the file is being stored, and the s3 amazon version worked in the iframe.

Working file URL: exocad webview
Not working file URL: exocad webview 3

1 Like

Ok, I see what you mean now.

I did run that code and it looks like Bubble is using sandboxing to prevent the code from using local storage so there’s no malicious code in the embedded content.

There are things you can do like ‘allow-same-origin’ flag. But using it has a lot of security issues.

But, probably the best thing to do is like was already mentioned, and get support help because they have their own unique way of doing some things.

Hopefully, they can help you with a solution.

If anyone is interested, I spoke to bubble support, and they said I needed to use a 3rd party file storage like AWS’s S3, which i’ve signed up for.
I am using the plugin by Pilot & Launch (Pilot & Launch Contributor Profile | Bubble) which has successfully allowed me to upload html without being sanitised.
I have two issues now:

  • When the file is uploaded to S3 it has the wrong metadata, and I need to set it to text/html for it to render in the browser
  • When the page is loaded and should show my html in an iframe, it downloads the file rather than rendering inside the iframe. This file downloads every time the page is refreshed too

thanks for your help!

Since you’re using an iframe I’m assuming you’re embedding the file on a website other than Bubble?

Since the URL changed, it looks like Bubble used to allow users to store files in their S3 bucket and now they don’t?

As for the file just downloading and not rendering…

first I’d contact the plugin support.

Without seeing your complete setup, if I were to take a guess at what the problem is, I’d say you don’t have your CORS configuration on your S3 bucket set up right. I would check that.

Hopefully, you get your problem fixed.

This topic was automatically closed after 70 days. New replies are no longer allowed.