Store the file object using a form post.
import { defineFilePond } from 'filepond';
import { locale } from 'filepond/locales/en-gb.js';
import { FormPostStore } from 'filepond/extensions/form-post-store.js';
defineFilePond({
locale,
extensions: [
// Add the FormPostStore extension
FormPostStore
]
})
Configuration
The FormPostStore extension accepts an option object of type FormPostStoreOptions which defines the properties below.
url
Server URL, defaults to empty string
url?: string
name
The name of the form field being submitted with the form POST, defaults to 'entry'
name?: string
fetchMetadata
When restoring a file, first fetch metadata so file details are updated sooner, defaults to true.
fetchMetadata?: boolean
getBasename
Hook that runs when determining the name for a file. Defaults to () => 'Untitled'.
getBasename?: (entry: FilePondFileEntry, blob: Blob) => string
resolveRequest
Resolve the URL and options sent to XMLHttpRequest
resolveRequest?: { metadata?: RequestResolver; store?: RequestResolver; restore?: RequestResolver; release?: RequestResolver; }
resolveResponse
Resolve the requested value from the response, when storing a file this is the server entry id, when restoring a file this is a File object
resolveResponse?: { metadata?: ResponseResolver<FormPostStoreMetadata>; store?: ResponseResolver<string>; restore?: ResponseResolver<File>; }