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

Enhancements

  • For upload, there should be multiple select file boxes, and you should be able to select more than one and thereby upload several files at once. Currently, files must be uploaded one-at-a-time, which is very tedious. Savvy students could use an ssh client instead, but that doesn't provide the integration of the knowledge of the submit directory location.
  • An experienced computer user wonders where the facilty to "rename" files and directories is. Many GUIs seem to make it all too easy to accidentally rename your files and folders. And within the context of aiding the submission process, one can think of arguments which would make the renaming of directories dangerous. So perhaps renaming was considered, but was deliberately omitted? But shouldn't clicking on a "Name" give several options, one of them being the "rename"?
  • One also wonders why certain file types can't just be viewed directly, e.g. JPG and .txt. Maybe HTML too.

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. See ST#57506
  • When uploading a file, if a non-existent filename is entered in the selection box, an empty file of that name gets created. This is only a problem if the browser allows free-style editing of that box (which some don't). However, free-style editing is sometimes actually more convenient for the user. (It's sometimes easier to modify the previous name than browse to pick the file). An even more bizarre error happens if the user enters free-style a non-absolute pathname. Hmm. I'm now guessing it's the browser which manufactures the empty file.

-- IsaacMorland - 09 Feb 2007

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