FileRules
Extended by
Section titled “Extended by”Properties
Section titled “Properties”accept?
Section titled “accept?”optional accept?: string;Comma-separated accept string, exactly as <input accept> takes it:
extensions (.png), full types (image/png), and wildcards (image/*).
dedupe?
Section titled “dedupe?”optional dedupe?: boolean;Treat two files with the same name, size and timestamp as the same file.
Default
Section titled “Default”truemaxFiles?
Section titled “maxFiles?”optional maxFiles?: number;Maximum number of files.
maxSize?
Section titled “maxSize?”optional maxSize?: number;Largest allowed file, in bytes.
minSize?
Section titled “minSize?”optional minSize?: number;Smallest allowed file, in bytes. Catches the 0-byte file a failed copy leaves behind.
validate?
Section titled “validate?”optional validate?: (file, existing) => string | boolean;Final say. Return true, false, or a string explaining the refusal.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
file | File |
existing | File[] |
Returns
Section titled “Returns”string | boolean