Hierarchy

  • UpDataEditControl
    • UpFileEditControl

Accessors

  • get required(): boolean
  • Check if the upload is required.

    Returns boolean

  • set required(value): void
  • Set the upload control as required or not required.

    Parameters

    • value: boolean

      Set to true to make the control required, or false to make it not required.

    Returns void

    NOTE

    This method affects the client-side behavior only and does not impact the server-side validation.

Methods

  • Check if the field content is valid:

    • are all uploads finished
    • if the field is required, does it have content

    Returns Promise<ValidationInfo>

  • Disable the file upload.

    Returns void

  • Enable the file upload.

    Returns void

  • Get detailed information about the uploaded files.

    Returns {
        element: HTMLElement;
        id: null | string;
        name: null | string;
        new: boolean;
    }[]

    An array of objects containing the file ID, the file name, a boolean indicating if the file is new and the HTML element.

    Example

    // get the file upload control
    var fileUpload = ix.util.getUp("<FILEUPLOAD-GUID>");

    // get detailed information about the uploaded files
    var filesInfo = fileUpload.getFilesInfo();
  • Gets the image editor associated with the specified file ID from the file upload control.

    Parameters

    • fileId: string

      The ID of the file.

    Returns null | Element

    The image editor corresponding to the given file ID.

    NOTE

    An image editor is only available for image files that have already been uploaded and only if at least one editor is activated in the file upload control options.

    Example

    // get the file upload control
    var fileUpload = ix.util.getUp("<FILEUPLOAD-GUID>");

    // determine the file ID you want to get the image editor for
    // you can use the `getValue(true)` or `getFilesInfo()` method to get the ID of an file
    // in this example we use the first file
    var fileId = fileUpload.getFilesInfo()[0].id;

    // get the image editor with the given file id
    var imageEditor = fileUpload.getImageEditor(fileId);
  • Gets all image editors within the file upload control.

    Returns ImageEditor[]

    NOTE

    An image editor is only available for image files that have already been uploaded and only if at least one editor is activated in the file upload control options.

    Example

    // get the file upload control
    var fileUpload = ix.util.getUp("<FILEUPLOAD-GUID>");

    // get all image editors within the file upload control
    var imageEditors = fileUpload.getImageEditors();
  • Get the number of files (uploaded & selected for upload).

    Returns number

  • Get the number of selected but not uploaded files.

    Returns number

  • Get the number of already uploaded files.

    Returns number

  • Get the value of the control.

    Parameters

    • Optional verbose: boolean

    Returns (null | string)[] | {
        element: HTMLElement;
        id: null | string;
        name: null | string;
        new: boolean;
    }[]

    The value of the control.

    • If verbose is true, the return value is an object containing detailed information about the files. See "getFilesInfo" method for more info.
    • Otherwise, it returns an array of file names.
  • Check if the upload is enabled.

    Returns boolean

  • Returns Promise<void>