Java File Upload Applet


Metadata input

(since 2.10.0)

metadata inputAllows user to input custom data in a form for each file in the upload queue. The form may contain following elements:

  • Title
  • Labels and inputs
  • Ok/Cancel buttons

In order to popup form user should click "Edit metadata" icon (internationalization key is metadataEditActionRenderer.toolTipText). Form discards and user input stored into file attributes when "Ok" button clicked or "Enter" key pressed. Form and changes discarded when "Cancel" button clicked or "Esc" key pressed.

In order to activate metadata input feature it is necessary to specify UploaderConfig parameters:

  • useMetadata=true
  • metadataDescriptorUrl=[link to metadata XML descriptor file, absolute or relative]

This is sample metadata.xml file that matches form on the screenshot above:

<metadata width="300" height="250" title="Metadata" ok="Ok" cancel="Cancel">
    <input type="text" name="fileName" label="Title"/>
    <input type="textarea" rows="4" name="description" label="Description" required="true"/>
    <input type="checkbox" name="check" label="Enabled"/>
    <input type="select" name="select" label="Select">
        <option value="1" name="option 1"/>
        <option value="2" name="option 2"/>
        <option value="3" name="option 3"/>
    <input type="radio" name="radio" label="Radio">
        <option value="1" name="option 1"/>
        <option value="2" name="option 2"/>
        <option value="3" name="option 3"/>

Hopefully this is self explanatory. Please note, that title, ok/cancel buttons and input labels are optional - specify empty string or remove attribute to omit element on the form. Form build is based on <input> elements sequence, elements added vertically. Input element attributes:

  • type — input element type, see below;
  • name — the name of parameter to send to server;
  • value — initial (default) value;
  • label — the label to display above input;
  • required — shows whether specified input is required for filling or not. Required input labels displayed in bold. Metadata edit link icon is different for files where all required fields are filled (filled)) or not (required). Please note, upload button is NOT disabled, if there are files in upoad queue with non-filled required fields;
  • massApplyEnabled — shows whether this input could be used for mass apply. Mass apply inputs have special checkbox right to it's label — if checked, current value will be applied to all upload files at once.
  • massApply — shows whether this input currently configured for mass apply (actual only if massApplyEnabled=true);
  • massApplyLabel — label to display for mass apply checkbox.

Following input types supported:

  • text — text field
  • textarea — multiline text field (scrollable), specify number of visible rows in a "rows" attribute
  • checkbox — check box
  • select — combo box with dropdown options
  • image — image preview (same as mouseover preview for file list)

For each input assigned upload file custom attribute with specified name, that is POSTed to server on upload. There is special input name "fileName", that affects displayed file name on thumbnail, but does not rename local file anyway.