Visual Force: Html file in static zipped resource is not opened inline but instead it is downloaded
Last updated 2022-02-10 ·Reference W-2041748 ·Reported By 3 users
Summary
When accessing a Visual Force page that refers to an HTML document in a static resource the html file in static zipped resource is not opened inline but instead it is downloaded.
Example of visual force page referring to HTML document in static resource:
<apex:page showHeader="false" standardStylesheets="false">
<apex:outputLink value="{!URLFOR($Resource.TestResource, 'test.html')}">outputLink</apex:outputLink>
</apex:page>
Repro
1. upload a zip file containing an html page called "test.html"
- Please use "TestResource" as the name of the static resource.
2. create the following Visualforce page
<apex:page showHeader="false" standardStylesheets="false">
<apex:outputLink value="{!URLFOR($Resource.TestResource, 'test.html')}">outputLink</apex:outputLink>
</apex:page>
3. Visit the visual force page
- You will see a link to the html file in static zipped resource.
4. click the link
- You will see html file is downloaded. This behavior is unexpected.
Workaround
Use "htm" for html file in zip file instead of "html"
Reported By (3)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.