>
WebRSH: Help: File Upload/Download:
WebRSH provides mechanisms for both uploading and downloading files. The
properties and limitations of these mechanisms are described below.
Uploading Files:
-
Files can be uploaded from an appropriate upload form, which can be invoked
by clicking the 'Upload' button in the File Manager, by clicking the 'UPLOAD'
link in WebRSH's Main Menu, or equivalently, by using the 'rshuploadform'
command from the Command Line. This form-based
mechanism for uploading files is based on RFC 1867, and would only work with
web browsers that support it (Netscape Navigator 2.0 and above).
-
To upload a file: Either enter the (full-path) name of the file you wish
to upload in the appropriate field, or click the 'Browse...' button and choose
the file. Then click the 'Upload' button. This would upload the file to the
working directory (of the form). If you wish to upload it to a different
directory, you should first get an upload form for the appropriate directory.
If you invoked the form from the Main Menu, this can be done by using the
'OPEN:[*]' links at the lower part of the form to change the working directory.
Otherwise, you can navigate the File Manager to a new directory and click 'Upload'.
-
There are two selectable (through the appropriate checkboxes on the upload form)
options when uploading a file: 'Overwrite Existing File' would attempt to overwrite
(without further prompting) an existing file in case it has the same name as the
uploaded file. 'Text Mode' would convert the uploaded file to a native text file
(where "native" means native to the server side, namely to the platform on which
WebRSH is running), and is recommended whenever text files are being uploaded (but
it should never be used for any files other than pure text files).
Both of these options are disabled by default. In order to be used, they must be
selected whenever a file is being uploaded.
Downloading Files:
-
WebRSH provides three basic methods for downloading files. We refer to them as
the 'GET', 'GET as BIN', and 'GET as TEXT' file-downloading methods. There are
three different interfaces from which these methods can be invoked: The 'GET'
Main Menu item, the File Manager, and the Command Line.
-
The three methods differ from each other by the MIME 'Content-type' reported
to the browser and by the capability of 'GET as TEXT' to optionally convert the
file to a non-native text file. There are also some mild differences depending
on the interface from which these methods are invoked: The name which the browser
associates with the downloaded file may depend on the interface (see below).
-
The 'GET' method sends the file to the client, reporting its MIME type according
to its extension and to WebRSH's MIME table (the mimetable.txt file in the
'Configuration Directory'). The file is sent in its precise binary form. Retrieving
files with the 'GET' method should result in a browser response that is similar
to the one attained when downloading the file from an ftp server or directly from a
web server. The 'GET' method can be invoked as follows:
-
By clicking an appropriate 'GET: * ' link in a list of 'Downloadable Links'.
(Such a list can be obtained either by clicking the 'GET' link in the Main Menu,
or by issuing the 'rshgetlist' command from the Command Line.)
-
By clicking the File Manager's 'Open/Get' button.
-
By using the 'rshget' command from the Command Line.
-
The 'GET as BIN' method sends the file to the client, reporting its MIME type as
'application/octet-stream'. The file is sent in its precise binary form. File
retrieval with the 'GET as BIN' method can be used to override browser behavior
that might otherwise occur if the file's "proper" MIME type where reported. Most
browsers would respond to the 'application/octet-stream' type by prompting the
user to save the file to disk. The 'GET as BIN' method can be invoked as follows:
-
By clicking an appropriate 'GET as BIN' link in a list of 'Downloadable Links'.
-
By clicking the File Manager's 'GET as BIN' button.
-
By using the 'rshgetbin' command from the Command Line.
-
The 'GET as TEXT' method sends the file to the client, reporting its MIME type as
'text/plain'. The file can be sent in its precise binary form or converted to a
non-native text file (that is, CR-LF pairs would be converted to single LF's or vice
versa), depending on the appropriate setting in the 'General Preferences' options setting
form. Most browsers would respond to the 'text/plain' type by opening the file for
viewing as a plain text file. This can be used to view many kinds of text files
that might otherwise be handled differently by the browser (e.g., tex files,
postscript files, perl scripts, html files, etc.), as well as files that are not
really text files, but have some meaningful text content (e.g., write files,
rtf files, word documents, etc.). The 'GET as TEXT' method can be invoked as
follows:
-
By clicking an appropriate 'GET as TEXT' link in a list of 'Downloadable Links'.
-
By clicking the File Manager's 'GET as TEXT' button.
-
By using the 'rshgettxt' command from the Command Line.
-
Handling the File's Name: When saving downloaded files to the disk of the
client machine, most browsers would prompt the user for a name, while suggesting
the file's original name as the default. It is thus convenient if the browser
"knows" the file's true original name. When files are downloaded using the
Command Line interface (namely, with the 'rshget' command), there is no way for
the browser to know what this true name is, and thus most browsers would consider
it to be the name of the WebRSH script (e.g., webrsh.pl). However, when files are
downloaded using the File Manager or a 'Downloadable Link', WebRSH uses an
'Extra Path Information' mechanism to convey the file's name to the browser:
The name is being appended to the WebRSH script URL. There are, however, two
things to notice with this arrangement:
-
While a 'Downloadable Link' includes the name information in the WebRSH-generated
link, and would thus work with any browser; the File Manager uses a dynamical
JavaScript mechanism to generate an appropriate URL. This would work with
Netscape Navigator (version 2.0 or higher, with JavaScript enabled) and
Microsoft's Internet Explorer 4.x, but would probably not work with any other
currently shipping browser (in which case, the browser would associate the file's
name with the WebRSH script name like when downloading using the Command Line
interface). Thus, the 'Downloadable Links' interface has an advantage over the
File Manager when downloading files using a non-JavaScript-enabled browser.
- Since the name-conveying mechanism involves making the name part of a URL,
the name would be encoded to conform to the URL standard (RFC 1738). That is,
(at least some) non-alphanumeric characters would be replaced by combinations
of the form %XX, where XX is the character's ASCII code (hex) number.
Thus, filenames which contain non-alphanumeric characters
would be converted to an encoded form, and it may be necessary to manually correct
the default name proposed by the browser prior to saving them. This issue is
not specific to WebRSH. It occurs whenever files are being retrieved by a
web browser (regardless of the retrieval protocol). Here too, there is a certain
difference between the File Manager and the 'Downloadable Links' interface.
The File Manger encodes using JavaScript's 'escape' function, and would convert
essentially all non-alphanumeric characters to their encoded values. The
'Downloadable Links' interface encodes using WebRSH's own 'UrlEncode' function,
and would leave certain non-alphanumeric characters (that are allowed in URL's)
in their original form. Moreover, it replaces white spaces by underscores (rather
than by '%20'), and is thus likely to provide "better" filenames in some cases.
-
Remark: The different file-downloading methods are implemented to provide the
user with a somewhat greater flexibility than what is usually provided by a web
browser. They should be effective with most browsers, and in particular, with
Netscape's. Unfortunately, they do not provide much when using Microsoft's Internet
Explorer (versions 3.0x, 4.0). Internet Explorer usually ignores the server-reported
'Content-type', and decides by itself what to do with the file.
In some cases, it also ignores the file's name.