| Module name |
viewfile ViewfileCgiScript |
| Location |
TWIKIROOT/bin/viewfile |
| Summary |
Presents contents of previous versions of attachments |
| Primary Author |
NicolasLee |
Purpose
This script delivers old versions of the attachments stored under the
PubDirectory. The most recent version is directly exposed through Apache's mapping of the
PubDirectory to a URL.
Used by
AttachViewfileWorkflow:
- This cgi script is invoked by the user when clicking on 'action' from the attachment table to get to the attach screen then following the view link on one of listed versions in the bottom table.
TWiki Modules used
This
CGI script depends on the following TWiki modules for functionality:
External Modules used
This
CGI script also depends on the following external modules:
This section lists the methods that can be used by the scripts and by other modules
These do not need to be not documented yet
Please see
CodevDocumentationProject and
CodevDocumentationProjectDev for comments on the format of these pages.
Why not make it so that the all attachments are delivered using this script? This way, we could ensure that permissions are adhered to when viewing an attachment rather than have the pub directory exposed directly.
--
MartinCleaver - 01 Jul 2002
I'd like to see some discussion of module names in case there is ever an opportunity to do some renaming.
Maybe no renaming is necessary, but when I saw viewfile I was not immediately clear whether this meant viewing a TWiki page (which I know is stored in a plain txt file) or viewing an attached file.
If the module for viewing a page is named viewpage (or viewtopic) there is no problem, but if not, maybe we should rename name this module to "viewattachedfile".
Update: Ok, looking a little further, it seems that the modules to deal with a page (save, rename, etc.(?)) don't include an object in the name, so maybe things are better than I thought (once I am more familiar with the code).
But then, upload, which is for an attached file, does not include "file". Should it, for consistency?
--
RandyKramer - 01 Jul 2002
I agree that it would be clearer to have the scripts named more clearly and agree that viewattachment and uploadattachment would be clearer names. However, I'd put these on a nice-to-have list rather than a must-do list, for consideration when that part of the system is up for redesign rather than a reason to do such a redesign.
If
CommonFrontEndCgiScript were to be implemented then these script names would become the name for the verbs. See
CommonFrontEndCgiScript for details.
--
MartinCleaver - 02 Jul 2002