Optional
container: ElementReferenceAn optional container. When given, only abort all uploads within that element. Can be the upload element itself.
A promise that resolves once all uploads are done.
One or multiple upload elements.
Data to upload.
Name of the file.
An promise that resolves when alls uploads were added and uploaded successfully.
Optional
container: ElementReferenceAn optional container. When given, only waits until all uploads within that element have finished. Can be the upload element itself.
A promise that resolves when all uploads are done.
Disables the AJAX upload feature. Aborts all pending uploads, removes all finished uploads, and removes all listeners so that no new AJAX uploads are started.
This must be called with the same container that was passed to AjaxUploadManager.enable.
Container with the uploads, usually the xm-form
.
A promise that resolves once all uploads are done.
Registers the appropriate listeners for all AJAX enabled upload fields inside the given container. This uses event delegation, so you can add elements inside the container dynamically after calling this function.
Container with the uploads, usually the xm-form
.
An object with the event sources provided by the AJAX upload manager, such as when an upload begins, progresses, or was successful. You can subscribe or unsubscribe from these events.
When an upload was selected and the AJAX upload was started.
When a pending AJAX upload was cancelled, such as when the user presses the cancel button.
When the error message of failed upload was cleared.
When all pending AJAX uploads are complete, irrespective of how they completed (via success, failure, or by being aborted). Whenever an AJAX upload completes, this event is triggered with the closest parent DOM element of the completed AJAX upload that contains only completed AJAX uploads.
When a file upload failed, such as due to a network failure or checksum mismatch.
When a pending upload made progress. This event is triggered in semiregular intervals, but no guarantees are made as to the exact timing.
When an uploaded AJAX file was removed, such as when the user presses the remove button.
When the AJAX file upload item was restored. This happens e.g. during server validation when the form is returned by the server.
When a file was uploaded successfully.
Optional
container: ElementReferenceAn optional container. When given, only returns the count for the upload within that element. Can be the upload element itself.
The number of pending uploads.
Optional
container: ElementReferenceAn optional container. When given, restricts the search to that element. Can be an upload element itself.
The first upload item in the given container, or undefined
when no such element exists.
Optional
container: ElementReferenceAn optional container. When given, only returns the uploads within that element. Can be an upload element itself.
All upload items in the given container.
Checks whether the AJAX feature is enabled for a given upload
element. When this returns false
, other methods such as getUpload
should not be used.
A container with the upload, or the upload element itself.
true
when the element is an upload element and the AJAX
upload feature is enabled for that element, false
otherwise.
Stops the upload if any upload is any progress, or removes the uploaded file if a file was uploaded.
One or multiple upload elements.
A promise that resolves once all uploads were removed.
Container with the uploads, usually the xm-form
.
Removes all listeners so that no new AJAX uploads are started, keep pending and finished uploads. Useful e.g. when you want to wait until all uploads have finished, but do not want to allow new uploads to be initiated.
This must be called with the same container that was passed to AjaxUploadManager.enable.
Container with the uploads, usually the xm-form
.
Manages all AJAX uploads and provides an API for checking the available uploads, as well as allowing for new uploads to be added programmatically.