HTTP handlers for file upload and download operations.
Provides Ring-compatible handlers for file operations.
HTTP handlers for file upload and download operations. Provides Ring-compatible handlers for file operations.
(delete-file-handler storage-service & [may-access?])Handler for file deletion endpoint.
Path parameter:
Handler for file deletion endpoint. Path parameter: - file-key: Storage key of the file
(download-file-handler storage-service)(download-file-handler storage-service signing-secret & [may-access?])Handler for file download endpoint.
Path parameter:
Handler for file download endpoint. Path parameter: - file-key: Storage key of the file
(get-file-url-handler storage-service & [may-access?])Handler for getting a file URL (direct or signed).
Path parameter:
Query parameter:
Handler for getting a file URL (direct or signed). Path parameter: - file-key: Storage key of the file Query parameter: - expiration: Expiration time in seconds (optional, default: 3600)
(storage-routes storage-service)(storage-routes storage-service
{:keys [base-path signing-secret may-access? upload-limits]})Reitit route data for the storage endpoints, as this module's :api.
Versioning prepends /api/v1, so paths here carry no /api prefix.
Parameters:
Reitit route data for the storage endpoints, as this module's `:api`.
Versioning prepends `/api/v1`, so paths here carry no `/api` prefix.
Parameters:
- storage-service: Instance of IStorageService
- options: Map with optional :base-path (default: "/storage") and
:may-access?, the app's check on a key (libs/storage/AGENTS.md, BOU-1075),
and :upload-limits, {:max-size :allowed-types :allowed-extensions} (BOU-1076)(upload-file-handler storage-service & [may-access? limits])Handler for file upload endpoint.
Expects multipart/form-data with:
Query parameters, which can only tighten the configured limits (BOU-1076):
Handler for file upload endpoint. Expects multipart/form-data with: - file: The file to upload (required) - path: Storage path (optional) - visibility: 'public' or 'private' (optional, default: private) Query parameters, which can only tighten the configured `limits` (BOU-1076): - max-size: Maximum file size in bytes - allowed-types: Comma-separated list of allowed MIME types - allowed-extensions: Comma-separated list of allowed extensions
(upload-image-handler storage-service & [may-access? limits])Handler for image upload endpoint with processing options.
Expects multipart/form-data with:
The configured limits hold here too (BOU-1076).
Handler for image upload endpoint with processing options. Expects multipart/form-data with: - file: The image file to upload (required) - path: Storage path (optional) - visibility: 'public' or 'private' (optional) - create-thumbnail: 'true' to create thumbnail (optional) - thumbnail-size: Thumbnail max dimension in pixels (optional, default: 200) The configured `limits` hold here too (BOU-1076).
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 |