Class FileInput<T extends FileInput<T>>

Direct Known Subclasses:
OorianFileInput

public class FileInput<T extends FileInput<T>> extends Input<T>
HTML file input element for file upload functionality.

This class extends Input to provide a file selection control that allows users to choose one or more files from their device for upload. Supports file type filtering via the accept attribute.

Features:

  • File selection from local device
  • File type filtering with accept attribute
  • Support for multiple file selection
  • Integration with HTML forms for file upload

Usage:

 FileInput fileInput = new FileInput();
 fileInput.setAccept("image/*");  // Accept only images
 fileInput.setMultiple(true);     // Allow multiple files
 
Since:
2007
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • FileInput

      public FileInput()
      Constructs a new FileInput.
  • Method Details

    • setAccept

      public final T setAccept(String value)
      Sets the accept attribute specifying accepted content types for file inputs.

      Used on <input> elements with type="file" to filter file selection. Accepts comma-separated MIME types or file extensions (e.g., "image/*", ".pdf,.doc").

      Overrides:
      setAccept in class InputElement<T extends FileInput<T>>
      Parameters:
      value - Comma-separated list of accepted content types.
      Returns:
      This element for method chaining.
    • setCapture

      public final T setCapture(String capture)
      Sets the capture attribute for media capture on mobile devices.

      Used on <input> elements with type="file". Values include "user" (front-facing camera) and "environment" (rear-facing camera).

      Overrides:
      setCapture in class InputElement<T extends FileInput<T>>
      Parameters:
      capture - The capture value (user, environment).
      Returns:
      This element for method chaining.