FILE command


Syntax:

  FILE [ERASE] [TYPE content-type] [BINARY|TEXT] [NOCACHE] NAME filespec

The file named by 'filespec' will be sent to the client. 'filespec' should normally be a fully qualified name (if it is not, GoServe would look for it in the GoServe working directory). Either forward or backward slashes may be used as directory separators; the OS/2 file systems accept either.

After this command has ended, the connection to the client is closed, so this is a 'completion command'.

The optional keywords may be specified, in any order, and have the following effects:

Here are some examples:

  1. Returning an HTML file to a Web client:
      file type text/html name d:/gohttp/index.htm
    
  2. Returning a temporary image file to a Web client:
      file erase type image/gif name d:/gohttp/$7681.80
    
  3. Returning a .ZIP file to a Gopher client:
      file binary name d:/gogopher/gogopher.zip
    

Notes:

  1. The filespec may not include an 'upwards reference' sequence ("..\" or "../"), as such a sequence could possibly allow clients access to any file on the server machine.
  2. All data sent to a client with an HTTP header should be described by a Content-Type field in the header; GoServe will therefore only generate a header automatically if the TYPE option was specified or the HEADER command has been used to add header lines. In this latter case, it is the responsibility of the filter to supply the Content-Type field if the TYPE option was not used.
  3. Internet Media Types were formerly known as MIME (Multipurpose Internet Mail Extensions) Content Types. MIME is described in RFC 1521 and RFC 1522. The media types are used in the HTTP protocol so that clients can determine how to process data received from servers. Some common types are listed in the sample filter.

[ previous section | GoServe | next section ]

From 'goserve.doc', version 2.32.
Copyright © International Business Machines Corporation, 1993, 1995.
All rights reserved.