API Docs for: 0.0.1
Show:

HTMLInputElement Class

Module: uploader

Methods

resetFileSelect

() chainable

Provided by the extend-element module.

Defined in src/vdom/partials/extend-element.js:4369

Hides the pop-up and empties the files-list of an input element of the type file.

sendFiles

(
  • url
  • [params]
  • [options]
)
Promise

Sends the input's files by using an AJAX PUT request. Additional parameters can be through the params argument.

The Promise gets fulfilled if the server responses with STATUS-CODE in the 200-range (excluded 204). It will be rejected if a timeout occurs (see options.timeout), or if xhr.abort() gets invoked.

Note: params should be a plain object with only primitive types which are transformed into key/value pairs.

Parameters:

  • url String

    URL of the resource server

  • [params] Object optional

    additional parameters. NOTE: these will be set as HEADERS like x-data-parameter on the request! should be a plain object with only primitive types which are transformed into key/value pairs.

  • [options] Object optional
    • [sync=false] Boolean optional

      By default, all requests are sent asynchronously. To send synchronous requests, set to true.

    • [headers] Object optional

      HTTP request headers.

    • [timeout=300000] Number optional

      to timeout the request, leading into a rejected Promise. Defaults to 5 minutes

    • [progressfn] Function optional

      callbackfunction in case you want to process upload-status. Function has 3 parameters: total, loaded and target (io-promise)

    • [withCredentials=false] Boolean optional

      Whether or not to send credentials on the request.

    • [parseJSONDate=false] Boolean optional

      Whether the server returns JSON-stringified data which has Date-objects.

    • [emptyFiles=true] Boolean optional

      Whether the empty the inputElement after transmitting has completed

Returns:

Promise:

on success: Object any received data on failure an Error object reason {Error} The returned promise has an abort-method to cancel all transfers.

showFileSelect

() chainable

Provided by the extend-element module.

Defined in src/vdom/partials/extend-element.js:4355

Shows the pop-up of an input element of the type file.