Images and uploads
What it does
- Tells the image picker where to look, and where images uploaded in the editor go.
- Can show asset folders under the name of the object they belong to.
- Sets the size and type of files people can upload in Keel.
Default
The picker searches all assets. Editor uploads go to /dashboard-uploads. Files up to 100 MB in Assets and 25 MB in the editor, of 22 common types.
Options
| Key | Default | What it does |
|---|---|---|
image_folder | / | Asset folder the image picker searches |
upload_folder | /dashboard-uploads | Asset folder for images uploaded in the editor. Also the starting folder for uploads in Assets. |
folder_labels.<pattern>.class | – | Class of the objects the folders belong to |
folder_labels.<pattern>.field | – | Field whose value is the {value} part of the folder path |
uploads.max_mb | 100 | Largest file, in MB, uploaded in Assets (1–2048) |
uploads.editor_max_mb | 25 | Largest image, in MB, uploaded in the editor (1–2048) |
uploads.zip_max_mb | 500 | Largest total size, in MB, of one Download as ZIP in Assets (1–10240) |
uploads.zip_max_files | 500 | Most files in one Download as ZIP in Assets (1–5000) |
uploads.types | 22 types, see below | File extensions people can upload in Assets |
The default types: jpg, jpeg, png, webp, avif, gif, svg, mp4, webm, mov, mp3, wav, pdf, doc, docx, xls, xlsx, ppt, pptx, txt, csv, zip.
Example
yaml
keel:
image_folder: /photos
upload_folder: /photos/Uploads
folder_labels:
'/photos/Properties/{value}': { class: Property, field: code }
uploads:
max_mb: 20
editor_max_mb: 10
types: [jpg, jpeg, png, webp, avif, gif, pdf]
With folder_labels, the folder /photos/Properties/MR-1042 reads as the name of the property with code MR-1042, and the image library opens in that folder when you pick images for that property.
Good to know about uploads
- PHP must allow the same size. PHP's
upload_max_filesizeandpost_max_sizeapply first. If they are lower thanuploads.max_mb, uploads fail above the PHP limit.keel:setup --checkshows it (for the CLI's PHP; the web server's PHP can differ). - The limits and types apply to Keel's own uploaders: Assets and the content editor's image upload. They do not change Pimcore Studio's own asset uploader.
- Types that can run code (for example
php,html,js,exe) can never be allowed.cache:clearfails with a message such askeel.uploads.types: "php" can run code on the server and cannot be allowed. - SVG is allowed by default, but an SVG file can contain scripts. Remove
svgif people you do not fully trust can upload; the same holds forsvgz(not allowed unless you add it). - The editor's image upload needs a file with an extension (
photo.jpg, notphoto).
What admins change in Customize
Nothing.