Forcing The Type - Netscape ENTERPRISE SERVER 6.0 - NSAPI PROGRAMMER GUIDE Manual

Nsapi
Table of Contents

Advertisement

Flow of Control in obj.conf
For more information about MIME types, see Appendix B, "MIME Types."

Forcing the Type

If no previous
matching file extension in the
after
recognize the file extension, it is a good idea to force the type to be
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
The function that forces the type is
For example, the following directives first instruct the server to look in the MIME
types table for the MIME type, then if the
the file extension was not found in the MIME types table), set the
text/plain
ObjectType fn="type-by-extension"
ObjectType fn="force-type" type="text/plain"
If the server receives a request for a file
does not find a mapping for the extension
type
directive is successful, forcing the
The following example illustrates another use of
type
the MIME types table. In this case, all requests for resources in
http://
directory
request, the server processes
processing the ones in the default object. This object has one
which forces the
36
Netscape Enterprise Server NSAPI Programmer's Guide • November 2001
ObjectType
type-by-expression
magnus-internal/cgi
.
attribute. Since the
type
is forced to
magnus-internal/cgi
server_name
/cgi/
D:/netscape/server4/docs/mycgi/
to be
type
directive has set the type, and the server does not find a
types table, the
MIME
has been executed. Usually if the server does not
.
.
force-type
attribute has not been set (that is,
type
abc.dogs
.dogs
attribute has not already been set, the second
attribute to
type
before the server gets a chance to look in
are translated into requests for resources in the
directives in the object named
ObjectType
magnus-internal/cgi
still has no value even
type
text/plain
type
, it looks in the MIME types table,
, and consequently does not set the
.
text/plain
. In this example, the
force-type
. Since a name is assigned to the
ObjectType
.
, so
attribute to
before
cgi
directive,

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise server 6.0

Table of Contents