Although this feature can be very useful, it could also be very dangerous.
Therefore this feature works only from local pages (with a URL starting
with file://localhost/
), and only if the
Allow Shell commands setting
is selected. If you haven't selected this setting, a warning requester is
displayed whenever you try to follow such a hyperlink. In this requester you can
abandon the command, or allow it to continue.
x-aweb:command/your_DOS_commandIf the user clicks on the hyperlink, your_DOS_command is executed. The output of the command is directed to an auto opening console window, unless you specify another output redirection in your command.
Because compatible HTML mode stops the
URL at a space, make sure you have escaped all spaces in the command
by " 
" or else the command won't work if the
user has selected compatible HTML mode.
Example:
<a href="x-aweb:command/dir sys: all">get dir</a>
would allow the user to execute the dir sys: all
command by a click on the words "get dir
".
Note: The DOS command is executed in a separate shell,
with a current directory set equal to the current directory of AWeb. You
are advised to use only absolute path names in the DOS command, or else
the result will depend on which directory happened to be the current
directory when you started AWeb. When AWeb is running, you can use the
assign name AWebPath:
as an absolute reference to the
directory where the AWeb executable is located.
x-aweb:rexx/your_ARexx_macroIf the user clicks on the hyperlink, your_ARexx_macro is started with the ARexx port for this window as the default command port.
ACTION="x-aweb:command/your_command"
attribute in your <FORM>
tag to execute the command
if the user submits the form. Similarly, you can include a
ACTION="x-aweb:rexx/your_macro"
attribute to start
the ARexx macro.
METHOD=GET
(the default), form
parameters are converted to Amiga DOS style parameters: the field
name will be used as the argument name, and the field value will be
used as argument value. The value will be quoted, with the escape,
newline and quote characters in the value escaped as
required by Amiga DOS.
Note: switch arguments (/S) cannot be passed in this way. You could use a script instead, like the example below.
Parameters for ARexx macros are passed in the same format as for DOS scripts. The argument string will contain the name, an equal sign, and a quoted value for each form parameter. Have a look at the second example below for one possible way of parsing this.
Note that the total length of all arguments passed in this way is limited to about 4000 characters. The excess is truncated. If your form might yield a longer argument set, use METHOD=POST instead.
METHOD=POST
, a temporary file is
created. The command or ARexx script will be called with exactly one
argument, the file name. The temporary file contains the message in
exactly the same way as it would have been sent to a HTTP server.
In short, this means:&
character.
+
characters.
%XX
sequence,
where XX
is the hexadecimal representation of the character.
Note that you should use the default form encoding
(ENCTYPE="application/x-www-form-urlencoded"
, or don't specify
the ENCTYPE
attribute). The multipart/form-data
encoding type is not supported for Shell and ARexx forms.
For file upload fields (<INPUT TYPE=FILE>
) the file
name is included in the message when using default encoding, not
the file contents as it would for multipart/form-data
forms. This is probably what you want in your command or script.
OPEN
command for
this purpose. If you re-use the name of your file for different responses,
be sure to add the RELOAD
switch to prevent AWeb from showing
the previous (cached) document again.
Of course, this will work better from within an ARexx macro than from
within a DOS script. In a DOS script, you have no way of determining to
which ARexx port you should address the OPEN
command.
Another way is to load the resulting document directly into AWeb while
you are creating it, without the need to create a temporary file. Look
at the description of the
CHANOPEN
command
for details.