WebSTAR 4 Manual & Technical Reference

Manual Contents | Chapter Contents | Previous Page | Next Page

WebSTAR Directory Indexer

To display a listing of files in a folder, via a browser, use the WebSTAR Directory Indexer Plug-In. All you have to do is put a special file name in the folder, and WebSTAR will display a list of files instead of a default page.

 

Using Directory Indexer

To tell WebSTAR to display the directory index listing (rather than a default index page) for a folder, put a file named .message into the folder, as described below. When a browser requests that folder in a URL (that is, the URL ends with the folder name and a slash), for example:

http://www.domain.com/widgets/

the directory index listing for the widgets folder will be displayed.

The first 100 files in a folder will be displayed, alphabetically. If there are more files, the Directory Indexer will include a "More" button, which will display additional files. However, there may be a significant delay in displaying large numbers of files.

WebSTAR does not install the WebSTAR Directory Indexer Plug-In by default. Use the WebSTAR Server Suite Installer to install it. It does not require any additional RAM.

Enabling Directory Indexing: the ".message" File

You must create a .message file in each folder that will be display a listing. It's just a text file, named with a period followed by the word "message":

 
.message

Do not add any text before the period.

The Directory Indexer will always run if there is a file named .message in a folder.

The presence of this file is a signal to the WebSTAR Directory Indexer Plug-In to display the contents of that folder, overriding any default index file.

Disk utilities, such as Norton, may alert you that you should fix files starting with a period. Do not allow them to "fix" these files, or these Plug-Ins will stop working.

Display a Header: Text in the ".message" File

The .message file is used for two things. Its existence triggers the directory index listing, and the contents are displayed as a header to the listing.

The file contents can be a plain text string or HTML. It is processed by the WebSTAR SSI Plug-In (if installed) for character set encoding and other SSI processing. Although you can use HTML in this file, be careful with the encoding, as non-standard HTML can cause problems with the display. Note that the <TITLE> tag will be ignored.

Display a Footer: the ".footer" File

To display information at the bottom of the directory index listing, create a file called .footer (a period followed by the word "footer"). The contents of this file (HTML or text) are displayed at the bottom of the directory index listing, as shown on Using Directory Indexer .

Allow Upload: the ".upload" File

To allow people to upload files, you must have a file named .upload in the folder. Directory Indexer will display a form at the bottom of the listing. However, many older browsers do not support this feature.

For more information on uploading in the directory index listing, see File Upload Option and WebSTAR File Upload .

Aliases and Security

The directory index listing will display aliases to files in other folders and mounted volumes. You can use this to allow people viewing your website to open or download pictures, text and HTML files, or any other file that you have access to from your server.

Before you add aliases to a folder with a .message file in it, review your security strategy, and think about who will have access to that file. It's often better to make a copy for the website, so you know exactly what the public will see.

For more security features, see WebSTAR Directory Indexer Administration .

Binhexing and Uploading

Visitors to your site can display or download the files by clicking on them in the browser. If you have installed WebSTAR Auto BinHex , it will encode the files with specified suffixes so that the file format can be transferred without losing important resource fork information. (see WebSTAR Auto BinHex ).

If you have installed the WebSTAR File Upload Plug-In, and placed a .upload file in the folder, the browser will automatically display an Upload form at the bottom of the index listing enabling users to upload files to this folder (see below and WebSTAR File Upload ).

Note that only newer browsers (such as Netscape version 3 or greater, Explorer version 4 or greater), will be able to upload the files. You may decide to use the WebSTAR FTP Server for uploading instead.

Icon Caching

WebSTAR Directory Indexer creates a folder called WebSTAR_Directory_Cache in the WebSTAR root folder. This folder contains cached icon graphics, to speed display for all directory index listings.

Files created by applications not installed on this Macintosh may have an incorrect icon displayed. To force the correct icon to appear, copy the application onto the server briefly. If the icons are still not displayed correctly, try rebuilding the Desktop database (the Mac's list of application and file icons). To do this, restart your machine and hold down the Command and Option keys through the Extension/Control Panel icons and until you see a dialog asking if you want to rebuild the Desktop, then click "OK". Once the icon displays correctly, you can delete the application from your hard drive. The icon will remain until you rebuild the Desktop database again.

Default Index Pages vs. Directory Index Listings

The presence of a .message file and a folder URL (folder name and slash \rather than file name) tells WebSTAR Directory Indexer to display the directory index listing.

http://www.domain.com/widgets/default.html

WebSTAR Directory Indexer Administration

To change settings on the WebSTAR Directory Indexer Plug-In, use your browser to open the administration page, and choose the Directory Indexer Plug-In at the URL like this:

http://www.domain.com/pi_admin.dir

(replacing the name www.domain.com with your host name). Use this page to configure the display, and don't forget to click the "Save" button to save your change to the server.

Files Beginning with a Period (.)

Files beginning with a period (like .message ) are used to mark certain directories that are served in a special way. In most cases, the default option "Hide files beginning with a period (.)" is best: you don't want people downloading these files.

However, if you ever need to display these files, you can do so by selecting the "Show" option on this page.

Don't forget to save your changes by clicking the "Save" button at the bottom of the Administration page.

Links to Parent Directories

The WebSTAR Directory Index Plug-In can automatically display the path of this folder, from the site root folder, in the form of clickable links, like this:

 
Contents of /widgets/bluewidgets/info/forms/

Each of these entries is a link to the default for that folder (either a directory index listing or a default index page).

The default is to generate these links. If you don't want people to see the layout of your site, click the "Hide links to parent directories" radio button.

The root folder for the host is always marked as "/".

Large or Small Icons

Files are shown with their standard Mac icons. You can choose to display them as large or small icons, just like on the Mac desktop.

Date Format

The Directory Index shows the list of files with the date they were last changed. You can see this in one of two ways:

 
Fri, Oct 24, 1997, 11:50 AM
 
10/24/97, 11:50 AM

Use Tables

The screenshot in WebSTAR Directory Indexer shows a display with tables. This allows the browser to line up the columns.

If you want to support browsers without tables, choose "Generate display without tables". The directory index listing is not quite as easy to read, but it's faster for displaying long listings.

Example with Small Icons, Short Date, No Tables, Upload, etc.

 

Binhex Options

These options control how the Directory Indexer works with the WebSTAR Auto BinHex Plug-In to encode files for transfer. For more information on binhexing, see WebSTAR Auto BinHex .

Don't allow downloading of applications is the first default. This reduces the chance that you will accidentally allow someone else to copy a program from your server. If you are using the server to distribute applications you have written or otherwise have the rights to, you can change this setting to allow downloading.

BinHex only when sending applications is the second default. It will encode the application data so that the resource fork is retained. As with all Auto BinHexing, there may be a delay while the encoding is going on.

If you have document files which include resource forks, such as SimpleText (with graphics or formatting), HyperCard stacks, CodeWarrior projects and so on, you can change this setting to encode them as well.

File Upload Option

You can specify that people can upload files directly from their browsers to the folder they are viewing. This requires the WebSTAR File Upload Plug-In, as described in WebSTAR File Upload .

The page will display a file name prompt, an edit field to type the name, a "Browse" button to choose a file, and buttons to Upload or Clear the field. This will appear at the bottom of the directory index listing, before the text from the .footer file, as in the example WebSTAR Directory Indexer .

To enable this option for directory listings, select Allow uploading of files in the administration page. You will also have to put a file called .upload into any folder that can accept file uploads.


Manual Contents | Chapter Contents | Previous Page | Next Page