ASP Tutorials - Herong's Tutorial Examples - v5.10, by Dr. Herong Yang
Response Header Lines for Static Files
This section describes HTTP response header lines generated by IIS server for static files based their file name extensions.
Static files can be served directly by IIS server, if you copy files to \inetpub\wwwroot, IIS will set "Content-Type" header line based on the file name extension and the MIME settings of the server configuration. Let's look at 3 commonly used file name extensions.
1. Command: "java HttpRequestGet /hello.html 80" gives us:
HTTP/1.1 200 OK Server: Microsoft-IIS/5.0 Date: Sat, 28 Dec 2002 19:27:28 GMT Content-Type: text/html Accept-Ranges: bytes Last-Modified: Sat, 28 Dec 2002 15:05:54 GMT ETag: "0f597e0a8e8c21:903" Content-Length: 38 <html><body>Hello world!</body></html>
Couple of interesting notes here:
2. Command: "java HttpRequestGet /dot.gif 80" gives us:
HTTP/1.1 200 OK Server: Microsoft-IIS/5.0 Date: Sat, 28 Dec 2002 03:14:22 GMT Content-Type: image/gif Accept-Ranges: bytes Last-Modified: Sun, 11 Aug 2002 21:48:20 GMT ETag: "0aafb4ddc43c21:903" Content-Length: 43 GIF89a......
As you can see, Content-Type was set correctly to "image/gif" for file name extension "gif", as defined in the MIME settings. I could not included the entity body here because it contains binary data.
3. Command: "java HttpRequestGet /hello.pdf 80" gives us:
HTTP/1.1 200 OK Server: Microsoft-IIS/5.0 Date: Sat, 28 Dec 2002 03:29:21 GMT Content-Type: application/pdf Accept-Ranges: bytes Last-Modified: Sat, 28 Dec 2002 21:22:12 GMT ETag: "01ab9248554c31:903" Content-Length: 909 %PDF-1.3 % ... 4 0 obj ......
Again, Content-Type was set correctly to "application/pdf" for file name extension "pdf", as defined in the MIME settings. I truncated the entity body to save some space.
Table of Contents
ASP (Active Server Pages) Introduction
IIS (Internet Information Services) 5.0
Managing Sessions with and without Cookies
scrrun.dll - Scripting Runtime DLL
►Managing Response Header Lines
Controlling Response Header Lines
►Response Header Lines for Static Files
Controlling Response Header Line Example
Sending Binary Files to Browsers
Calculation Speed and Response Time
Working with MS Access Database