Adding File Upload to your HTML Form

You can add the Appletfile Upload Applet to an existing HTML form by following these four 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 point to your client-side script that will process the file upload..
  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 processUpload(this)">
<INPUT TYPE="submit" VALUE="Upload">
</FORM>
<APPLET CODE="com/infomentum/Appletfile/FileUpload.class"
        ARCHIVE=FileUpload.jar
        NAME=FileUpload CODEBASE="/Appletfile/classes" WIDTH=420 HEIGHT=180 MAYSCRIPT>
<PARAM NAME="cabbase" 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.

Using Drag N Drop File Upload

By Default the drag n drop is ready to be used. Simply click on the applet to gain focus and then drag your file or folders to the applet file list. Thats all there is to it.