Odyssey Local App: Local File Access

Introduction

This is a web interface to the user's files. Implementation is in Java classes uw.unix.FileBrowser*. The main class is FileBrowserIndexHandler.

This application is installed at a specific base URL, which we will call BASE. A base path in the file system of the webserver is supplied via a Java File object FILE. Then the URL BASE/PATH/ will provide access to the file path FILE/PATH.

Feature Description

File and Directory Display

If the associated path does not exist, requesting this URL will report this fact and provide a button offering to create it as a directory.

If the associated path exists but is not a file or directory, a message to this effect will be displayed. This should not normally occur in our users' experience, but is possible with FIFOs and other special files.

If the associated path is a file, requesting this URL will present a link allowing the user to download the file contents.

If the associated path is a directory, requesting this URL will present a directory listing. The information in the listing is obtained by invoking GNU ls and parsing the results.

Display Parameters

Whether or not dot files are included, and whether or not certain of the columns are included, is controlled by a configuration parameter supplied in the query parameter "F". For example, specifying "?F=P" at the end of the URL will cause permissions to be displayed.

The parameters are mostly handled by the FileBrowserConfig class. The available parameters are:

  • A: Show all files. Displays hidden files.
  • P: Show permissions. Displays permission-related columns.
  • G: Show Inodes. Displays the inode number and link count. Probably not terribly useful.

File Management Actions

The directory listing has a "Select" column containing checkboxes, and an action selection menu at the bottom. Ticking some of the boxes and selecting an action, such as "Delete", will give a page allowing options to be selected and offering to complete the action.

For the most part these actions are implemented by invoking the appropriate Gnu utility.

In addition to the per-file actions, there is an "Upload File" form and a "Create Directory" form.

The file upload form allows the user to select a file from the machine running their browser and upload it into the directory they are looking at in the file browser. The filename used is the one supplied by the user's browser, which is typically its filename on the user's machine.

The create directory form takes a name and creates a subdirectory by that name.

Bugs and Enhancements

Bugs

  • When downloading a file, the existing filename is recommended to the browser and typically becomes the default filename when it is saved on the user's machine. The name is not escaped in the Content-Disposition header so a space in the filename will truncate it. The filename should be properly escaped. However, it should also be properly encoded so that a double quote or other special character in the filename won't confuse things.

-- IsaacMorland - 09 Feb 2007

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r3 - 2007-02-13 - IsaacMorland
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback