Index

mmo-upload

1 symbol · generated 5 Oct 2026

element

mmo-upload

mmo-upload.jhs:1

Drop files, or pick them, and send them to mmo.edms: a chunk at a time, two files at once, each one resumed where the server stopped when a chunk fails.

<mmo-upload url token labels attachment max accept></mmo-upload>
Extends
CustomShadowElement

Index

urlwhere mmo.edms' api is: the page's (MMO.edms.config.url) by default
tokenthe session's CSRF token: the page's by default
labelsthe labels of the files: ids, or quoted paths and "#tags", separated by spaces
attachmentthe uid of an entity the files are attached to
maxhow many files it takes at most
acceptthe types it takes, as an <input type="file"> says them (image,.pdf)
temporaryno file is made: each one's id is for the application to take its bytes
autothe files are sent as soon as they are dropped
disabledtakes no file
ViewDefault static readonly accessor
api readonly accessorThe api the files are sent to
disabled accessorGet the disabled attribute
labels accessorGet the labels attribute
attachment accessorGet the attachment attribute
temporary accessorGet the temporary attribute
auto readonly accessorGet the auto attribute
max accessorGet the max attribute
accept accessorGet the accept attribute
init()
handleLabelKeydown(event)Handle the keydown event of the label
filesChange(input)Handle the change event of the file input
addFiles(files)Add files to send: with auto, they are sent once they are all added
accepts(file)
addFile(file, submit)Add a file to send
removeItem(item)Stop sending a file, and forget it
submit(event)Send the files not sent yet (those that failed are sent again)
send(api, item)Send one file: it never throws, what went wrong is on its row
clear()Remove every file
update()The send button, and the frosted zone once nothing more can be added
.dragoverset while files are dragged over the element
.maxedset once it holds as many files as max
.no-submithides the send button (the page calls submit() itself)

Attributes9

url

mmo-upload.jhs

where mmo.edms' api is: the page's (MMO.edms.config.url) by default

url

token

mmo-upload.jhs

the session's CSRF token: the page's by default

token

labels

mmo-upload.jhs

the labels of the files: ids, or quoted paths and "#tags", separated by spaces

labels

attachment

mmo-upload.jhs

the uid of an entity the files are attached to

attachment

accept

mmo-upload.jhs

the types it takes, as an <input type="file"> says them (image,.pdf)

accept

temporary

mmo-upload.jhs

no file is made: each one's id is for the application to take its bytes

temporary

Properties9

disabled

accessormmo-upload.jhs:67

Get the disabled attribute

get disabled() set disabled(value)
Type
boolean

labels

accessormmo-upload.jhs:80

Get the labels attribute

get labels() set labels(value)
Type
string | array

attachment

accessormmo-upload.jhs:92

Get the attachment attribute

get attachment() set attachment(value)
Type
string

temporary

accessormmo-upload.jhs:104

Get the temporary attribute

get temporary() set temporary(value)
Type
boolean

accept

accessormmo-upload.jhs:138

Get the accept attribute

get accept() set accept(value)
Type
string

Methods11

handleLabelKeydown(event)

mmo-upload.jhs:150

Handle the keydown event of the label

handleLabelKeydown(event)
eventEvent- The event

filesChange(input)

mmo-upload.jhs:161

Handle the change event of the file input

filesChange(input)
inputHTMLInputElement- The input

addFiles(files)

mmo-upload.jhs:171

Add files to send: with auto, they are sent once they are all added

addFiles(files)
filesFileList | Array<File>

accepts(file)

mmo-upload.jhs:180
accepts(file)
fileFile
returnsbooleantrue if the element takes a file of that type (accept)

addFile(file, submit)

mmo-upload.jhs:194

Add a file to send

addFile(file, submit = true)
fileFile- The file to add
submit = trueboolean- with auto, send it at once
returns?Objectthe file's item, null if it is refused

removeItem(item)

mmo-upload.jhs:229

Stop sending a file, and forget it

removeItem(item)
itemObject- addFile

submit(event)

mmo-upload.jhs:242

Send the files not sent yet (those that failed are sent again)

submit(event = null)
event = null?Event- The event
returnsPromise<{files: Array<Object>, errors: Array<Error>>} the files made -- for a temporary upload, {id, name, temporary} -- and the errors

send(api, item)

mmo-upload.jhs:282

Send one file: it never throws, what went wrong is on its row

send(api, item)
apiMMO.edms.Api
itemObject- addFile
returnsPromise

update()

mmo-upload.jhs:318

The send button, and the frosted zone once nothing more can be added

update()

CSS hooks3

.dragover

mmo-upload.jhs

set while files are dragged over the element

.dragover

.no-submit

mmo-upload.jhs

hides the send button (the page calls submit() itself)

.no-submit