Formats and limits for assets
Which files an asset can be depends on how it arrives. The Asset Library itself takes images only; documents and other files go in through a file field on an entry. Images imported from a web address must be JPEG, PNG, or WebP. Beyond that, the limits are the ones each field sets: its formats, its dimensions, and for files, the allowed types and maximum size.
Which files an asset can be depends on how it arrives. The Asset Library itself takes images only; documents and other files go in through a file field on an entry. Images imported from a web address must be JPEG, PNG, or WebP. Beyond that, the limits are the ones each field sets: its formats, its dimensions, and for files, the allowed types and maximum size.
Requirements
A role that can manage the Asset Library to upload. To change a field's limits: a role that can edit the collection's fields.
By route
| Route | Accepts | Limits |
|---|---|---|
| Upload to the library | Images only, such as JPEG, PNG, and WebP | No size limit set by Sonta; the server's upload limit applies |
| Upload into an entry's image or gallery field | The formats the field allows | The field's formats; no separate size limit |
| Upload into an entry's file field | The file types the field allows, such as PDF or DOCX | The field's maximum file size, in MB |
| Import from a web address | JPEG, PNG, WebP | https only; address up to 2,048 characters; public servers only |
A field with no limits set accepts any file for its kind.
What a field can limit
| Field | Settings |
|---|---|
| Image | Allowed formats, default format, named sizes with width and height, default size, minimum and maximum width and height, required |
| Gallery | Allowed formats, named sizes, minimum and maximum width and height, required |
| File | Allowed file types, maximum file size in MB (at least 0.1), required |
Sizes and formats generated on upload
An image uploaded to the library can be given output formats and named sizes, such as a thumbnail and a large version. One version is generated for each format and size, and an image field shows the default format and size it is set to. A listing photo uploaded once can serve a small card on a search page and a full-width picture on the listing page.
Notes and limitations
- Documents need a file field. A PDF cannot be uploaded to the library directly; add a file field to the collection and upload it there.
- Names and tags. A stored file name can be up to 255 characters, and each tag up to 100.
- No version history. Earlier versions of an asset are not kept. To change a picture, replace the file on the asset or attach another.
Related
For the steps, see Upload a file or image, Import media from a URL, and Attach an asset to an entry.