![Netscape ENTERPRISE SERVER 6.1 Manual Download Page 39](http://html1.mh-extra.com/html/netscape/enterprise-server-6-1/enterprise-server-6-1_manual_1674653039.webp)
Flow of Control in obj.conf
Chapter
2
Syntax and Use of obj.conf
39
For more information about MIME types, see Appendix B, “MIME Types.”
Forcing the Type
If no previous
ObjectType
directive has set the type, and the server does not find a
matching file extension in the
MIME
types table, the
type
still has no value even
after
type-by-expression
has been executed. Usually if the server does not
recognize the file extension, it is a good idea to force the type to be
text/plain
, so
that the content of the resource is treated as plain text. There are also other
situations where you might want to set the type regardless of the file extension,
such as forcing all resources in the designated CGI directory to have the MIME
type
magnus-internal/cgi
.
The function that forces the type is
force-type
.
For example, the following directives first instruct the server to look in the MIME
types table for the MIME type, then if the
type
attribute has not been set (that is,
the file extension was not found in the MIME types table), set the
type
attribute to
text/plain
.
If the server receives a request for a file
abc.dogs
, it looks in the MIME types table,
does not find a mapping for the extension
.dogs
, and consequently does not set the
type
attribute. Since the
type
attribute has not already been set, the second
directive is successful, forcing the
type
attribute to
text/plain
.
The following example illustrates another use of
force-type
. In this example, the
type
is forced to
magnus-internal/cgi
before the server gets a chance to look in
the MIME types table. In this case, all requests for resources in
http://
server_name
/cgi/
are translated into requests for resources in the
directory
D:/netscape/servers/docs/mycgi/
. Since a name is assigned to the
request, the server processes
ObjectType
directives in the object named
cgi
before
processing the ones in the default object. This object has one
ObjectType
directive,
which forces the
type
to be
magnus-internal/cgi
.
ObjectType fn="type-by-extension"
ObjectType fn="force-type" type="text/plain"
Summary of Contents for ENTERPRISE SERVER 6.1
Page 1: ...NSAPI Programmer s Guide Netscape Enterprise Server Version6 1 April 2002 Draft...
Page 290: ...Miscellaneous 290 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Page 318: ...cinfo 318 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Page 336: ...Buffered Streams 336 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Page 344: ...344 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Page 350: ...350 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Page 356: ...356 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...