Last updated 19 January 2012. Created on 21 May 2007.
Edited by francis55, iantresman, dwillcox, VM. Log in to edit this page.

Introduction

WebFM (Web File Manager) implements a hierarchical filesystem unlike the traditional flat filesystem used to date by Drupal (a single directory indexed by a database). WebFM allows administrators to arrange files on the server in the same way they do on their local storage drives which greatly enhances the maneagability of large collections of documents.

WebFM uses Ajax and JavaScript to provide application intensive functionality such as drag-and-drop and context-sensitive menuing. JavaScript must be enabled for WebFM to function - functionality will not gracefully degrade for clients that have JavaScript disabled.

Go to the WebFM project page for releases, notes, issues and demo site links.

Installation & Configuration

  • Download the official release from the WebFM project page.
  • Unzip the archive and copy the 'webfm' directory to your modules directory (ie:/sites/all/modules). Alternatively copy the tarball to the module directory if you can unzip it on the server.
  • Enable the module on Drupal's admin/build/modules page. An install file updates the database with the necessary table additions.
  • Configure the module at admin/settings/webfm. Note: The configuration assumes that the 'File system path:' is set in the usual way at %file-sys. All WebFM directories are sub-directories of this 'File System' path. Set 'Download method:' radio to 'Public' since the module manages downloads.
    • Create the 'WebFM root directory'. If this directory doesn't already exist, the system will create it in the 'File System' root. Directory creation is not recursive so multi directory root paths must already exist inside the 'File System' directory. Set the directory permissions to 775 if the server is linux/bsd.
    • The icon path allows the user to substitute their own gifs. File names are hardcoded in the javascript so the icons will have to have identical names.
    • The 'Maximum resolution for uploaded images' input functions in the same fashion as the upload.module.
    • The 'Date Format' radio buttons set the day/month order in the browser listing date field.
    • The 'Display metadata title' checkbox sets the browser to display metadata titles rather than the actual filename if the metadata tile exists. Renaming files that use the metadata title must be done via the metadata editor. Note that node attachments always display the metadata title if available.
    • 'Default File Permissions' set the file level permissions for files inserted into the database. The exception is file uploads that create a version overwrite whereby the new file inherits the permissions from the previous file.
    • Roles that are granted the 'access webfm' permission will receive additional configuration fields for root path, extension white list, max upload file size and max total upload size. Roles with the 'access webfm' right but without a root directory cannot access the filesystem.
    • Roles granted the 'attach WebFM files' permission will be able to see and download attached files. 'Attachment List Properties' sets the presentation of attached files.
    • The 'IE Drag-and-Drop Normalization' is a sub-optimal solution for compensating for relative positioning in theme css. This feature is only available to #1 user.
    • The 'Webfm javascript debug' checkbox is only useful for users interested in looking under the covers or who want to develop the module.
    • The WebFM cron is a 'stored procedure' used for database cleanup of file records that are deleted outside of the WebFM interface (ie: OS shell, ftp). This feature is only available to #1 user.
  • Set WebFM rights in admin/user/access per role.
    • 'administer webfm' confers full rights to a role. Admins can see and operate on all files, including files not in the database. Only admins can create directories and access admin/settings/webfm.
    • 'access webfm' allows a role to download/view files via the WebFM browser. Only files referenced by the webfm_file table in the database are accessible. Only owners of a file (and admins) can move a file or modify it's metadata.
    • 'view webfm attachments' allows a role to see files attached to nodes via WebFM.
    • 'webfm upload' allows a role with the 'access webfm' right to upload files via the WebFM browser. The user who uploads a file is the the owner of that file.
  • Admins and File owners can set the following file level permissions from the context menu of each file:
    • Public download: Allows the file to be downloaded anonymously even if .htaccess exists.
    • Role View/Download: Allows users of the same role to view/download the file.
    • Role Attach: Allows users of the same role to attach the file to nodes.
    • Role Full Access: Allows users of the same role to have the same rights to the file as the owner with the exception of permission edits.
  • Enable attachments in admin/content/node-type/*type* for each content type that will accept attachments (default is disabled). (Look under Workflow Settings.)
  • A .htaccess file (apache servers) can be placed in the WebFM root (or sub-path) to secure file access. Webfm streams downloads and thus your browser doesn't require direct http access to the directories
  • Updating the menu cache by navigating to admin/build/menu may be necessary if upgrading from an earlier version of the module with different internal paths.
  • Translations of the module require revising the string array at the top of webfm.js.

General Usage

There are many ways to setup a file system hierarchy. The rules of any given system must be applied carefully if security of data is important.

The basic rules for users in a role with 'access webfm' rights:

  • The role root directory defines the domain and all subdirectories are accessible to the user.
  • The user cannot navigate above the role root directory.
  • Only files in the webfm_file table are accessible. Files uploaded by the user are owned by the user and are automatically in the database. Only module admins can view/operate on files not in the database.
  • The user has full control over files that he/she owns that stay within an accessible role root domain. File permissions can be locked down so that only the owner/admins can see or operate on a file. File permissions can be opened up so that anyone within the role can view or operate on the file.
  • Users with 'access webfm' rights cannot create/delete/move/rename directories. Only module administrators (users with 'administer webfm' permission or #1 user) can control the directory structure.

Roles with 'access webfm' rights can be subsets of other roles with 'access webfm' rights or they can be exclusive. Users can be members of multiple roles and will consequently have a separate left-hand tree for each unique root directory (roles can even share the same root directory). It is difficult to foresee how diverse users of the module will choose to set up their systems but the following simple examples are typical arrangements. Both examples presume that the drupal file-system directory is set to 'files', the WebFM module is installed and the 'WebFM root directory' is set to 'webfm'.

Example 1

The site requires 1 class of privileged users (A) to administer the file system and 2 classes of WebFM users (B & C) with access to file resources. Both roles will be able to upload files. Some WebFM users are members of both B & C while others are members of only one. Uploaded files are by default only accessible by the file owner and admins.

  • A site administrator will create 3 the roles A, B and C. Role A will have the 'administer webfm' permission set in .../admin/user/access. B & C will have the 'access webfm' and the 'webfm upload' permission set.
  • WebFM settings will now have a fieldset for roles B & C where the root directory for each role is set. The root of B is set to 'B' which automatically creates the 'files/webfm/B' directory. The root of C is set to 'C' which creates the directory 'files/webfm/C'. A user who is a member of only one of B or C will see a single left-hand directory tree that contains their domain. They will have no access to files within the other role domain. Users who are members of both B & C will have two left-hand directory trees and have the ability to move files they own or control between the two domains. Role A's root directory is the 'WebFM root directory' and thus A users see only a single left-hand tree of the entire module file-sys.
  • In WebFM settings, the 'Default File Permissions' are configured with all checkboxes unset. This combination of default file permissions means that files that are uploaded will initially only be viewable by the B or C user doing the upload (owner) and by A users. Individual file permissions are editable by the file owner or A user to permit other users to view/attach/modify the file. One consequence of granting the permission 'Role Full Access' is that a non-admin user with a single domain could lose contact with their own file if a dual domain non-admin user moves it to the other domain.

Example 2

The site requires 1 class of privileged users (A) to administer the file system and 2 classes of users (B & C) with access to file resources. C is determined to be a subset of B such that B can access it's own files as well as those of C. C will not be able to upload files to the browser but will only be able to view/download or attach files to nodes. B will be able to upload files.

  • A site administrator will create 3 the roles A, B and C. Role A will have the 'administer webfm' permission set in .../admin/user/access. B & C will have the 'access webfm' permission set. B will also have the 'webfm upload' permission set.
  • WebFM settings will now have a fieldset for roles B & C where the root directory for each role is set. First the root of B is set to 'B' which automatically creates the 'files/webfm/B' directory. Next the root of C is set to 'B/C' which creates the directory 'files/webfm/B/C'. Since C is a sub-dir of B, role B will have access to C but C will not be able to navigate above it's root to see B's files. The left-hand directory tree will appear different for B & C. B's tree will start at 'B' and have a 'C' sub-directory (and potentially other sub-directories as set up by A). C's tree is a subset of B's tree. Role A's root directory is the 'WebFM root directory'.
  • In WebFM settings, the 'Default File Permissions' are configured with 'Role View Access' and 'Role Attach Access' set. This combination of file permissions means that files that a B user uploads/moves into the C realm will by default be viewable by C and be attachable to nodes that C creates. A B file owner can manually modify the file permissions of each individual file to hide it or prevent it from being attached to content by a C user. Likewise the file permissions can be opened so that a C user can edit file attributes or move the file into another sub-directory of C.

In the above examples the site administrator may simply create the roles/access rules and then let an A user configure WebFM for B & C.

Managing files

Surf to /webfm . Here you will see a tree with 1 folder on the left and a table with a directory listing on the right. If you are just starting out, this table is empty.

Uploading a file

When you visit /webfm, below the directory listing you will find a link saying "File upload". Click this to expand the upload form. Now select the file you wish to upload by clicking the "Browse..." button and press "Upload".
Your file will always be uploaded in the directory you are currently viewing.

Managing a file

Once you have uploaded a file and it is visible in the directory listing, you can right click on it. When you do this, the "Context menu" will become visible and you will see the following options:

Delete file
Delete the from the website. Once deleted, you cannot recover it.
Rename file
By clicking this, you can rename the file. This is option is only available if you have set no title in "File meta information"
File meta data
By clicking this, you can enter more detailed information about the file. Title, description, ...
View file
View the file in your browser. If possible.
Download as file
Download the file to your computer
Remove file from database
Deletes all meta information about the file, but keeps the file in place.
File permissions
Set viewing, downloading, ... permissions for this file.

Note: not all options above may be availble, it depends on file type and file meta information.

Deleting a file

Use the "Delete file" option in the "Context menu"

Moving a file to another directory

Drag the file towards the tree on the left of the directory listing and drop it in the prefered folder.

Managing directories/folders

Creating a directory

On the top right of the Directory listing, you will see a yellow directory/folder icon. If you click this, it will create a new directory in the directory you are currently viewing. To rename it, right click on this directory and choose "Rename" from the context menu.

Managing a directory

Right click on a directory to open the "Context menu". In this context menu you will see the following options:

Create subdirectory
Create a new directory inside of this directory
Delete directory
Delete the directory and everything in it. Once deleted, you cannot recover it.
Rename directory
By clicking this, you can rename the directory.
Search directory
Opens the search box and allows you to search for files within the selected directory.
Set viewing, downloading, ... permissions for this file.

Note: not all options above may be availble, it depends on file type and file meta information.

Deleting a directory

Choose "Delete directory" from the Context menu.

Moving directory

Drag the file to the tree on the left and drop it in the directory you wish to place it int. You cannot place a directory in itself.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

francis55’s picture

A really worthwhile documentation page!

patrickPDD’s picture

Can anyone tell me how I can make files added to the WFM searchable by site visitors? Will 'inserting Files Into Database' enable these documents to be searchable by title, node assignment or metadata?