Simulate storing a file.
import { defineFilePond } from 'filepond';
import { locale } from 'filepond/locales/en-gb.js';
import { SimulatedStore } from 'filepond/extensions/simulated-store.js';
defineFilePond({
locale,
extensions: [
// Add the SimulatedStore extension
SimulatedStore
]
})
Configuration
The SimulatedStore extension accepts an option object of type SimulatedStoreOptions which defines the properties below.
bitrate
Maximum simulated load speed. Defaults to 1024000
bitrate?: number
tickrate
Delay in milliseconds between load ticks. Defaults to 250
tickrate?: number
connectionDelay
Delay in milliseconds before starting load. Defaults to 250
connectionDelay?: number
parallel
Total parallel load operations. Defaults to 4
parallel?: number
fetchStoredFile
Fetches an actual stored file to use for demo purposes.
fetchStoredFile?: (storageId: string, entry: FilePondEntry, options: { abortController: AbortController; onprogress: (e: ProgressEvent<EventTarget>) => void; onabort: () => void; }) => Promise<File>
log
Logs stored files to console. Defaults to true
log?: boolean