'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>
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Ivan Yang |