Adding File Upload to your HTML Form

You can add the AppletFile Upload Applet to an existing HTML form by following these three steps:

  1. Set the ACTION attribute of the FORM tag to point to your server-side script that will process the file upload.
  2. Add an onSubmit attribute to the FORM tag to invoke the FileUpload.submit method.
  3. Add the APPLET and PARAM tags necessary to initialize the Upload Applet.

Here is a simple example form:

<FORM ACTION="upload.asp" 
      onSubmit="return document.FileUpload.submit(document,this,true)">
<INPUT TYPE="submit" VALUE="Upload">
</FORM>
<APPLET CODE=FileUpload.class ARCHIVE=FileUpload.jar NAME=FileUpload 
        CODEBASE="/AppletFile/classes" WIDTH=420 HEIGHT=180 MAYSCRIPT>
<PARAM NAME="cabbase" VALUE="/AppletFile/classes/FileUploadIE3.cab">
<PARAM NAME="cabinets" VALUE="/AppletFile/classes/FileUpload.cab">
<PARAM NAME="directory" VALUE="C:\My Documents">
</APPLET>

In this example, the parameter directory is used to specify "C:\My Documents" as the default directory so that the first time the user adds a file, the Browse dialog will open in this directory.