(file-is-image? file)Returns true if the file's MIME type starts with image/.
Returns true if the file's MIME type starts with image/.
(format-file-size bytes)Formats bytes into human-readable string.
Formats bytes into human-readable string.
(matches-accept? file accept-str)Returns true if file matches the accept filter string. Accept format: comma-separated MIME types, wildcards (image/*), or extensions (.pdf). Returns true when accept is nil or empty (no filter).
Returns true if file matches the accept filter string. Accept format: comma-separated MIME types, wildcards (image/*), or extensions (.pdf). Returns true when accept is nil or empty (no filter).
(normalize {:keys [accept-raw multiple-present? max-size-raw max-files-raw
disabled-present? required-present? name-raw]})Derives a complete view-model map from raw attribute values.
Derives a complete view-model map from raw attribute values.
(parse-positive-int s)Parses string to positive integer, returns nil on failure.
Parses string to positive integer, returns nil on failure.
(validate-file file accept-str max-size)Validates a single file. Returns {:valid? bool :reason string-or-nil}.
Validates a single file. Returns {:valid? bool :reason string-or-nil}.
(validate-files files accept-str max-size max-files current-count)Validates a batch of files. Returns {:accepted [...] :rejected [{:file :reason}]}. Enforces max-files limit based on current-count.
Validates a batch of files. Returns {:accepted [...] :rejected [{:file :reason}]}.
Enforces max-files limit based on current-count.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |