Using octet-stream to resolve problems with raw page content being displayed
 Technote (troubleshooting)
 
Problem(Abstract)
How webmasters can correct problems with raw page content being displayed in the web browser of end users in IBM® HTTP Server, Apache and WebSphere® Application Server.
 
Resolving the problem
In cases where the raw page content of a static web page, or a dynamically generated web page is being displayed by a browser, changing the settings of the Web server or the application Web Server allows the end user the chance to decide how the content will be displayed.
For example, a user selects a program listed on a Web page for download, but instead, the contents are displayed as text (sort of) on the screen. Since it is impossible to save a program to a file using "Save as" correctly. The user cannot easily save the file.

Another example is where a user attempts to display something like an Adobe Acrobat file, but does not have the Acrobat Reader plug-in loaded. Ideally, the user should be prompted to choose an application so that they can select the Acrobat Reader from a list.

In cases like these, the web master should be setting up the Web server to direct the user to save the file or prompt the user for an application that will properly display the page. Here are two configuration options available to webmasters using Apache or IBM HTTP Server:

binary/octet-stream:
Sample directive: AddType binary/octet-stream .exe .jar .war .ear
By adding a stanza, such as the one above, to the httpd.conf Web server file, when a user selects a static file with the filetypes .exe, .jar, .war, .ear they will be prompted to save the file to disk.

application/octet-stream:
Sample directive: AddType application/octet-stream .zip .gz .pdf
By adding a stanza, such as the one above, to the httpd.conf Web server file, when a user selects a static file with the filetypes .zip, .gz or .pdf they will be prompted to select an application that can display this file correctly. For this sample directive, the user could select WinZip for .zip and .gz files and the Adobe Acrobat Reader for .pdf files. In the case of WebSphere Application Server, a servlet or JSP author can set the
Content-Type in the response header to binary/octet-stream or application/octet-stream for the same result.

See the official Apache documentation on:
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers WebSphere Application Server Servlet Engine/Web Container
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > IBM HTTP Server > Runtime
Operating system(s): Windows
Software version: 6.0
Software edition:
Reference #: 1051133
IBM Group: Software Group
Modified date: Aug 2, 2005