Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is iframe content downloading as a file?

When visiting the webpage with the following iframe, the HTML file is downloaded as a file instead of just displaying on the page within the iframe. Why is it downloading and how can it be embedded correctly within a webpage?

<iframe scrolling="no" src="https://example.com/files/example.htm" width="780" height="1400"></iframe>

If it helps to know, the file is being stored in Azure Storage as a blob:

<iframe scrolling="no" src="https://aerccgrsuatpnoapoddat01.blob.core.windows.net/pnoa/html/00460522-001.htm" width="780" height="1400"></iframe>
like image 284
crayden Avatar asked Oct 19 '25 12:10

crayden


1 Answers

Please try to set the Content-type of the blob as text/html. Then in my side, I can see it works in iframe.

The steps as below:

Nav to azure portal -> your storage account -> Storage Explorer(preview) -> blob container -> your blob container -> right click the .htm file, and select properties -> Then set Content-type to text/html. -> click save button.

enter image description here

like image 87
Ivan Yang Avatar answered Oct 22 '25 03:10

Ivan Yang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!