Skip to content

Interface: AnyDropCoreOptions<Self> ​

Defined in: core/src/options.ts:10

Self is the type of this inside callbacks (the instance).

Type Parameters ​

Type ParameterDefault type
SelfAnyDropCore

Properties ​

PropertyTypeDescriptionDefined in
accept(this, file, done) => voidYour own check, called after the built-in ones: done() accepts, done(message) rejects.core/src/options.ts:93
acceptedFilesstring | nullComma-separated .ext, type/* and type/subtype list (the accept attribute syntax).core/src/options.ts:91
autoPauseOnHiddenbooleanPause on pagehide, and when a request fails while the page is hidden (iOS suspension). Default true.core/src/options.ts:124
autoProcessQueuebooleanStart uploading as soon as files are queued. With false, call processQueue(). Default true.core/src/options.ts:100
autoQueuebooleanQueue accepted files when their batch closes. With false, call enqueueFile(). Default true.core/src/options.ts:102
autoResumeOnReconnectbooleanResume when the browser comes back online, and probe for a lost connection by itself.core/src/options.ts:126
binaryBodybooleanSend the file (or chunk) as the raw request body, with no form fields. Not with uploadMultiple. Default false.core/src/options.ts:45
chunkingbooleanSplit files larger than chunkSize into chunks. Default false.core/src/options.ts:52
chunkSizenumberBytes. Default 2 MiB.core/src/options.ts:56
chunkStatusUrlstring | nullGET ?uploadId= target that returns the chunks the server already has; used to resume. Default null.core/src/options.ts:113
chunksUploaded((this, file, done, instance) => void) | nullReplaces the built-in finalize request. this is the options object; the instance is the third argument. done() succeeds; done(error) with an Error or a non-empty string fails the file (FINALIZE_FAILED).core/src/options.ts:68
connectivityProbeUrlstring | nullHEAD target that tells whether the server is reachable while the connection is lost.core/src/options.ts:133
defaultHeadersbooleanSend the Accept: application/json, Cache-Control: no-cache and X-Requested-With: XMLHttpRequest headers. Default true.core/src/options.ts:26
dictFileSizeUnitsFileSizeUnitsUnit labels used by filesize(); a partial object is merged with the defaults.core/src/options.ts:150
dictFileTooBigstringMessage when a file exceeds maxFilesize; and are replaced.core/src/options.ts:136
dictFileUnreadablestringError message for a file that can no longer be read (cloud placeholder, moved or deleted).core/src/options.ts:146
dictInvalidFileTypestringMessage when a file does not match acceptedFiles.core/src/options.ts:138
dictInvalidPathstringError message for a path with a .. segment.core/src/options.ts:148
dictMaxFilesExceededstringMessage when a file is rejected because of maxFiles.core/src/options.ts:144
dictResponseErrorstringMessage when the server answers with an error and no body; is replaced.core/src/options.ts:140
dictUploadCanceledstringText for a canceled upload (shown by the UI).core/src/options.ts:142
filesizeBasenumberBase used by filesize(): 1000 or 1024. Default 1000.core/src/options.ts:87
finalizeUrlstring | nullPOST target that assembles a chunked file after its last chunk. Default null.core/src/options.ts:115
foldersbooleanAccept folder drops (and, in the UI, show the folder picker where supported).core/src/options.ts:105
forceChunkingbooleanChunk files smaller than chunkSize too. Default false.core/src/options.ts:54
headersRecord<string, string> | nullExtra headers sent with every request (uploads, manifest, chunk status, finalize). Empty values are not sent. Default null.core/src/options.ts:24
ignoreHiddenFilesbooleanSkip files whose name starts with . inside dropped or picked folders.core/src/options.ts:95
manifestUrlstring | nullPOST target of the folder manifest. Default null.core/src/options.ts:111
maxChunksInFlightnumber | nullOptional instance-wide cap on upload POSTs in flight; null = no cap.core/src/options.ts:49
maxFilesnumber | nullMaximum number of accepted files; extra files are rejected (MAX_FILES) and emit maxfilesexceeded. Default null.core/src/options.ts:89
maxFilesizenumber | nullMiB; falsy disables the check.core/src/options.ts:85
methodstring | ((this, files, dataBlocks) => string)HTTP method of upload requests, upper-cased. A function gets the files and data blocks. Default 'post'.core/src/options.ts:18
parallelChunkUploadsnumber | booleanChunks of one file in flight: false = 1, true = parallelUploads, or a number.core/src/options.ts:58
parallelUploadsnumberFiles uploading at once.core/src/options.ts:47
paramNamestring | ((n) => string)Form field name of the file; a function gets the file index (file[0], file[1], ... with uploadMultiple). Default 'file'.core/src/options.ts:41
params| Record<string, unknown> | ((this, files, xhr, chunk) => void | Record<string, unknown> | null | undefined) | nullExtra form fields, or a function returning them. Merged over the built-in ad* fields; a null or undefined value drops a built-in field (to rename it).core/src/options.ts:31
pauseMode"abort" | "finishChunk"What a pause does to requests in flight: 'abort' stops them (the chunk is sent again later), 'finishChunk' lets them finish. Default 'abort'.core/src/options.ts:118
persistKeystring | nullScope of resume records; null = url when it is a string, else 'default'.core/src/options.ts:122
persistStatebooleanSave acknowledged chunks in IndexedDB so an upload can resume after a reload. Default true.core/src/options.ts:120
preserveEmptyFoldersbooleanKeep folders that hold no files, and send them in the manifest.core/src/options.ts:107
renameFile((this, file) => string) | nullName sent to the server; changes only the last path segment.core/src/options.ts:97
retryChunksbooleanDefault true.core/src/options.ts:60
retryChunksLimitnumberHow many times a failed request is retried, so at most this plus one attempts. Default 3.core/src/options.ts:62
sendManifestbooleanSend the folder manifest (needs manifestUrl) before the first file of each batch. Default false.core/src/options.ts:109
stallTimeoutnumber | nullA request with no progress for this long (ms) while its body is sent, or no response for four times as long once it is sent, is aborted as STALLED and retried. null = off.core/src/options.ts:131
timeoutnumber | ((this, files) => number | null) | nullRequest timeout in ms, or a function of the files; null = none.core/src/options.ts:22
transformFile((this, file, done) => void) | nulltransformFile(file, done): called when the file starts processing; pass the blob to upload to done. Chunk info is recomputed from it.core/src/options.ts:80
transportTransport | nullSends the requests. null = the built-in XMLHttpRequest transport.core/src/options.ts:82
uploadMultiplebooleanNon-chunked only; throws together with chunking.core/src/options.ts:43
urlstring | ((this, files, dataBlocks) => string) | nullUpload URL, or a function of the files being sent and their data blocks. Without it, processQueue() starts nothing.core/src/options.ts:16
withCredentialsbooleanSend cookies and credentials on cross-origin requests. Default false.core/src/options.ts:20

Released under the MIT License.