Did you know ... Search Documentation:
http_dirindex.pl -- HTTP directory listings
PublicShow source

This module provides a simple API to generate an index for a physical directory. The index can be customised by overruling the dirindex.css CSS file and by defining additional rules for icons using the hook file_extension_icon/2.

To be done
- Provide more options (sorting, selecting columns, hiding files)
Source http_reply_dirindex(+DirSpec, :Options, +Request) is det
Provide a directory listing for Request, assuming it is an index for the physical directrory Dir. If the request-path does not end with /, first return a moved (301 Moved Permanently) reply.

The calling conventions allows for direct calling from http_handler/3.

Source directory_index(+Dir, :Options)// is det
Show index for a directory. Options processed:
Sort the files in the directory listing by Field. Field is one of name (default), size or time.
Sorting order. Default is ascending. The altenative is descending
DCG used to render a name in the table. The File is passed.
Source mime_type_icon(+MimeType, -Icon) is det[private]
Determine the icon that is used to show a file of the given extension. This predicate can be hooked using the multifile http:mime_type_icon/2 hook with the same signature. Icon is the plain name of an image file that appears in the file-search-path icons.
MimeType- is a term Type/SubType as produced by file_mime_type/2.
Source http:mime_type_icon(+MimeType, -IconName) is nondet[multifile]
Multi-file hook predicate that can be used to associate icons to files listed by http_reply_dirindex/3. The actual icon file is located by absolute_file_name(icons(IconName), Path, []).
See also
- serve_files_in_directory/2 serves the images.