Why are images not appearing in published web pages?

The images are missing from a published web page, because the MIME type for the images has not been defined in the web server.

Description

A published HTML page containing links or <img> tags to images (.image files) in the are not displayed (broken) in the browser. Most web servers, except Tomcat, are configured by default not to serve unknown or undefined MIME types.

Solution

You need to define the MIME type for the images.

For Apache

Create a distributed configuration file called .htaccess at the same level as the main page of your site and add the following line to it:
AddType application/octet-stream .image

For Tomcat

If the default behavior of serving unknown MIME type is turned off, create a file called web.xml at the same level as the main page of your site and add the following to it:
<?xml version="1.0"?>
<web-app> 
   <mime-mapping>  
      <extension>image</extension>    
    <mime-type>application/octet-stream</mime-type>  
  </mime-mapping>
</web-app>

For IIS 7 and up

Create a web.config file at the same level as the main page of your site and add the following to it:
<configuration>
	<system.webServer>
		<staticContent>
			<remove fileExtension=".image" />
			<mimeMap fileExtension=".image" mimeType="application/octet-stream" />
		</staticContent>
		<httpProtocol>
			<customHeaders>
				<remove name="X-Content-Type-Options" />
				<add name="X-Content-Type-Options" value="sniff" />
			</customHeaders>
		</httpProtocol>
	</system.webServer>
</configuration>

This adds the .image file extension to the octet-stream mimeType and authorizes Chrome and Internet Explorer browsers to bypass the mimeType sent in the HTTP header and discover ("sniff") the correct mimeType to use to display .image files, particularly in instances when the "nosniff" value was enabled globally.

For IIS 6

Create an addMIMEType.vbs file containing the following and execute it using cscript.exe addMIMEType.vbs:


Dim MimeMapObj, MimeMapArray, MimeTypesToAddArray, WshShell, oExec, counter 
Const ADS_PROPERTY_UPDATE = 2 
 
' Set the MIME types to be added
MimeTypesToAddArray = Array(".image", "application/octet-stream")
 
' Get the mimemap object 
Set MimeMapObj = GetObject("IIS://LocalHost/MimeMap")
 
' Call AddMimeType for every pair of extension/MIME type
For counter = 0 to UBound(MimeTypesToAddArray) Step 2
    AddMimeType MimeTypesToAddArray(counter), MimeTypesToAddArray(counter+1)
Next
 
' Create a Shell object
Set WshShell = CreateObject("WScript.Shell")
 
' Stop and Start the IIS Service
Set oExec = WshShell.Exec("net stop w3svc")
Do While oExec.Status = 0
    WScript.Sleep 100
Loop
 
Set oExec = WshShell.Exec("net start w3svc")
Do While oExec.Status = 0
    WScript.Sleep 100
Loop
 
Set oExec = Nothing
 
' Report status to user
WScript.Echo "MIME types have been registered."
 
' AddMimeType Sub
Sub AddMimeType (Ext, MType)
    Dim i 
    ' Get the mappings from the MimeMap property. 
    MimeMapArray = MimeMapObj.GetEx("MimeMap") 
 
    ' Add a new mapping. 
    i = UBound(MimeMapArray) + 1 
    Redim Preserve MimeMapArray(i) 
    Set MimeMapArray(i) = CreateObject("MimeMap") 
    MimeMapArray(i).Extension = Ext 
    MimeMapArray(i).MimeType = MType 
    MimeMapObj.PutEx ADS_PROPERTY_UPDATE, "MimeMap", MimeMapArray
    MimeMapObj.SetInfo
    
End Sub