Interface: AnyDropCoreOptions<Self>
Defined in: core/src/options.ts:10
Self is the type of this inside callbacks (the instance).
Type Parameters
| Type Parameter | Default type |
|---|---|
Self | AnyDropCore |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
accept | (this, file, done) => void | Your own check, called after the built-in ones: done() accepts, done(message) rejects. | core/src/options.ts:93 |
acceptedFiles | string | null | Comma-separated .ext, type/* and type/subtype list (the accept attribute syntax). | core/src/options.ts:91 |
autoPauseOnHidden | boolean | Pause on pagehide, and when a request fails while the page is hidden (iOS suspension). Default true. | core/src/options.ts:124 |
autoProcessQueue | boolean | Start uploading as soon as files are queued. With false, call processQueue(). Default true. | core/src/options.ts:100 |
autoQueue | boolean | Queue accepted files when their batch closes. With false, call enqueueFile(). Default true. | core/src/options.ts:102 |
autoResumeOnReconnect | boolean | Resume when the browser comes back online, and probe for a lost connection by itself. | core/src/options.ts:126 |
binaryBody | boolean | Send the file (or chunk) as the raw request body, with no form fields. Not with uploadMultiple. Default false. | core/src/options.ts:45 |
chunking | boolean | Split files larger than chunkSize into chunks. Default false. | core/src/options.ts:52 |
chunkSize | number | Bytes. Default 2 MiB. | core/src/options.ts:56 |
chunkStatusUrl | string | null | GET ?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) | null | Replaces 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 |
connectivityProbeUrl | string | null | HEAD target that tells whether the server is reachable while the connection is lost. | core/src/options.ts:133 |
defaultHeaders | boolean | Send the Accept: application/json, Cache-Control: no-cache and X-Requested-With: XMLHttpRequest headers. Default true. | core/src/options.ts:26 |
dictFileSizeUnits | FileSizeUnits | Unit labels used by filesize(); a partial object is merged with the defaults. | core/src/options.ts:150 |
dictFileTooBig | string | Message when a file exceeds maxFilesize; and are replaced. | core/src/options.ts:136 |
dictFileUnreadable | string | Error message for a file that can no longer be read (cloud placeholder, moved or deleted). | core/src/options.ts:146 |
dictInvalidFileType | string | Message when a file does not match acceptedFiles. | core/src/options.ts:138 |
dictInvalidPath | string | Error message for a path with a .. segment. | core/src/options.ts:148 |
dictMaxFilesExceeded | string | Message when a file is rejected because of maxFiles. | core/src/options.ts:144 |
dictResponseError | string | Message when the server answers with an error and no body; is replaced. | core/src/options.ts:140 |
dictUploadCanceled | string | Text for a canceled upload (shown by the UI). | core/src/options.ts:142 |
filesizeBase | number | Base used by filesize(): 1000 or 1024. Default 1000. | core/src/options.ts:87 |
finalizeUrl | string | null | POST target that assembles a chunked file after its last chunk. Default null. | core/src/options.ts:115 |
folders | boolean | Accept folder drops (and, in the UI, show the folder picker where supported). | core/src/options.ts:105 |
forceChunking | boolean | Chunk files smaller than chunkSize too. Default false. | core/src/options.ts:54 |
headers | Record<string, string> | null | Extra headers sent with every request (uploads, manifest, chunk status, finalize). Empty values are not sent. Default null. | core/src/options.ts:24 |
ignoreHiddenFiles | boolean | Skip files whose name starts with . inside dropped or picked folders. | core/src/options.ts:95 |
manifestUrl | string | null | POST target of the folder manifest. Default null. | core/src/options.ts:111 |
maxChunksInFlight | number | null | Optional instance-wide cap on upload POSTs in flight; null = no cap. | core/src/options.ts:49 |
maxFiles | number | null | Maximum number of accepted files; extra files are rejected (MAX_FILES) and emit maxfilesexceeded. Default null. | core/src/options.ts:89 |
maxFilesize | number | null | MiB; falsy disables the check. | core/src/options.ts:85 |
method | string | ((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 |
parallelChunkUploads | number | boolean | Chunks of one file in flight: false = 1, true = parallelUploads, or a number. | core/src/options.ts:58 |
parallelUploads | number | Files uploading at once. | core/src/options.ts:47 |
paramName | string | ((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) | null | Extra 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 |
persistKey | string | null | Scope of resume records; null = url when it is a string, else 'default'. | core/src/options.ts:122 |
persistState | boolean | Save acknowledged chunks in IndexedDB so an upload can resume after a reload. Default true. | core/src/options.ts:120 |
preserveEmptyFolders | boolean | Keep folders that hold no files, and send them in the manifest. | core/src/options.ts:107 |
renameFile | ((this, file) => string) | null | Name sent to the server; changes only the last path segment. | core/src/options.ts:97 |
retryChunks | boolean | Default true. | core/src/options.ts:60 |
retryChunksLimit | number | How many times a failed request is retried, so at most this plus one attempts. Default 3. | core/src/options.ts:62 |
sendManifest | boolean | Send the folder manifest (needs manifestUrl) before the first file of each batch. Default false. | core/src/options.ts:109 |
stallTimeout | number | null | A 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 |
timeout | number | ((this, files) => number | null) | null | Request timeout in ms, or a function of the files; null = none. | core/src/options.ts:22 |
transformFile | ((this, file, done) => void) | null | transformFile(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 |
transport | Transport | null | Sends the requests. null = the built-in XMLHttpRequest transport. | core/src/options.ts:82 |
uploadMultiple | boolean | Non-chunked only; throws together with chunking. | core/src/options.ts:43 |
url | string | ((this, files, dataBlocks) => string) | null | Upload URL, or a function of the files being sent and their data blocks. Without it, processQueue() starts nothing. | core/src/options.ts:16 |
withCredentials | boolean | Send cookies and credentials on cross-origin requests. Default false. | core/src/options.ts:20 |