Guides
Images, videos and PDFs
Upload the pictures, videos and PDFs of your content once: images converted to WebP when they arrive, every file kept in R2 and served from your Hollware.
Images, videos and PDFs
An image, a video or a PDF is a file of a site. It is sent once, kept in an R2 bucket of your account, and named in content by a reference that never changes: asset:ast_…. An image is converted once when it arrives; a video or a PDF is kept as it came. Agents upload them over MCP, people in the admin under Images.
A project needs two bindings in wrangler.jsonc, which projects made with 1.0 have:
"r2_buckets": [{ "binding": "MEDIA", "bucket_name": "my-hollware-media" }],
"images": { "binding": "IMAGES" },hollware deploy creates the bucket the first time, as it creates the database. Without MEDIA, upload_asset answers unavailable. Without IMAGES, every file is kept as it came, unconverted. hollware doctor says which one is missing.
Upload an image
An agent calls upload_asset with the file in base64, its name and its alt, what the image shows for whoever cannot see it:
{ "filename": "continuum.png", "alt": "The Continuum logo on a dark background", "data": "iVBORw0KGgo…" }Instead of data, it can name a public https address in url, which Hollware downloads: at most 10 MB, following up to five redirects.
{ "filename": "continuum.png", "alt": "The Continuum logo on a dark background", "url": "https://example.com/continuum.png" }It answers with the asset: its reference, its url, the format and size it is served at, and the format and size it was sent at. The same file sent again answers exists with the same asset, so an agent can upload without checking first. The same file in another site of the deployment is another asset, with an id of its own. list_assets lists the images of the site, newest first, and get_asset gets one by its id.
What a file is comes from its bytes, never from its name: JPEG, PNG, WebP, AVIF, GIF and SVG images, at most 10 MB; MP4 and WebM videos and PDFs, up to the site's media.maxBytes, 100 MB by default. Anything else is refused with what to do. A url that declares its size (Content-Length) is streamed to R2 as it arrives, so it may be as large as maxBytes; one that does not is read up to 10 MB.
Videos and PDFs
A video or a PDF goes up the same way, and is kept byte for byte: Cloudflare Images never sees it. Its width and height are null, and it has no copies.
The largest a site takes is maxBytes, in its media setting, from 1 byte to 5,000,000,000 (one R2 object). In the admin it is under Site, in Images, as Largest video or PDF, in megabytes. Images stay at 10 MB, what Cloudflare Images converts.
The URL of a video answers Range, so a player seeks without loading the whole file, and a PDF opens in the browser. Both are served with nosniff, as what their bytes say they are.
Upload a large file
Base64 in a call to upload_asset carries at most 10 MB. A larger file from a computer goes as the body of PUT /v1/assets, with a personal token with content:write; Hollware streams it to R2 as it arrives, so the Worker never holds it:
curl -X PUT "https://cms.example.com/v1/assets?filename=launch.mp4&alt=The%20launch%20of%20the%20product" \
-H "Authorization: Bearer $HOLLWARE_TOKEN" --data-binary @launch.mp4It answers what upload_asset answers: 201 with the asset, 200 when the site has the file already. Before it reads a byte it answers 411 without a Content-Length, 413 past maxBytes, 403 without content:write, and 400 without a filename or an alt.
One request carries at most what the Cloudflare plan of the zone allows: 100 MB on Free and Pro, 200 MB on Business, 500 MB on Enterprise. A larger file goes up in parts of 50 MiB:
POST /v1/uploadswith{ "filename": "…", "alt": "…", "bytes": 734003200 }checks the size againstmaxBytesand answers{ "upload": { "id": "upl_…", "partBytes": 52428800, "parts": 14, "expiresAt": "…" } }.PUT /v1/uploads/<id>/parts/<n>, from 1 toparts, takes each part as its body: every part of exactlypartBytes, the last what remains. It answers the part'setag.POST /v1/uploads/<id>/completewith{ "parts": [{ "part": 1, "etag": "…" }, …] }makes the asset, and answers asPUT /v1/assetsdoes.
DELETE /v1/uploads/<id> gives up on one. Only the person who started an upload continues it, for 24 hours; after that the daily cron drops what it holds in R2. The admin does all of this by itself: a file past 50 MiB goes up in parts.
Show it
Write the reference wherever the file goes, in the frontmatter or in the Markdown: an image as an image, a video or a PDF as a link.
---
title: Moving a monorepo to a new toolchain
img: asset:ast_e51afa61663c33d06276f786da
---

Read [the privacy policy](asset:ast_9c0d1e2f3a4b5c6d7e8f9a0b1c) before you sign up.Copy for Markdown, on the card of a file under Images, gives the one or the other.
A Markdown image with no alt of its own takes the asset's when a site reads it, so the contract images-have-alt lets it through. What an image shows can change later: update_asset with its id and a new alt, or Edit what it shows on its card under Images. Every entry that shows it without an alt of its own reads the new one; the file never changes.
Sites read the URL, never the reference: getEntry over RPC and the read API turn every asset: into the image's URL, in the frontmatter and in the rendered document. Over MCP an agent reads what it wrote, references included.
The URL is <your Hollware>/assets/<site>/<id>, public and cached for a year: an asset never changes, so a new picture is a new asset.
Responsive images
When an image arrives, Hollware also makes its narrower copies, so a phone loads a small one: one for each of the site's media.widths narrower than the image, 640 and 1280 pixels by default. Each is served at <url>/<width>.
A site gets them without asking. In the HTML of an entry, and in the document a site reads, each image carries srcset, sizes and its width and height, so the page keeps its room while it loads:
<img src="https://cms.example.com/assets/blog/ast_e51a…" srcset="https://cms.example.com/assets/blog/ast_e51a…/640 640w, https://cms.example.com/assets/blog/ast_e51a…/1280 1280w, https://cms.example.com/assets/blog/ast_e51a… 1600w" sizes="(min-width: 1600px) 1600px, 100vw" width="1600" height="900" alt="…">A size the author wrote is kept. For the images of the frontmatter, a cover, a summary a site reads (getEntry, listEntries) carries images: by URL, the width, height and srcset of each.
const cover = entry.images?.[entry.frontmatter.img]
// <img src={entry.frontmatter.img} srcset={cover?.srcset ?? undefined} width={cover?.width} …>upload_asset, get_asset and list_assets answer widths and srcset too. Images uploaded before 1.0.0-rc.3 have no copies.
How images are converted
Each site says how in its media setting, part of its structure (read it with get_structure, change it with update_site):
"media": { "format": "webp", "quality": 85, "maxWidth": 2400, "widths": [640, 1280], "keepOriginals": true, "maxBytes": 104857600 }Those are the defaults, which a site that says nothing gets. In the admin, they are under Site, in Images.
| Sent as | Kept as |
|---|---|
| JPEG | format at quality, lossy |
| PNG | format, lossless: screenshots, diagrams and logos keep their edges, and transparency |
| GIF | format with every frame, animated |
| WebP, AVIF | as they came |
| SVG | as it came, never converted |
Wider than maxWidth (320 to 8192 pixels), an image is scaled down, never up. format takes webp, avif (smaller still, a little slower to encode) or original, which keeps every file as it came, without copies. widths takes up to four widths from 320 to 8192, smallest first, or [] for no copies. A change applies to the images uploaded after it.
Hollware keeps the original of each file too, never served, at /v1/assets/<id>/original with a personal token, so a later change of format has the originals to start from. A site that would rather take less storage sets keepOriginals to false (Keep the original of each image in the admin): it keeps only the file it serves and its copies, and the download of an original, and hollware export, give the file served instead. The images uploaded before keep theirs.
SVG
An SVG stays a vector and is never rewritten. Hollware accepts one only when nothing in it can run or reach out: no <script>, <foreignObject>, <iframe>, <embed> or <object>, no on… attribute, no javascript: or data: URL, no <!DOCTYPE> or <!ENTITY>, and no link outside the file. Character references and entities other than the five of XML (&, <, >, ", '), backslashes and animations of a link (<set> or <animate> of href) are refused too, since they can spell what the other rules look for. Anything else is refused with the part to remove. An SVG optimizer cleans most files that come from a design tool.
It is served with a security policy that runs nothing even if a browser opens it on its own.
What it uses
The conversion is Cloudflare Images on R2 storage. Each new image is one transformation, two when it is wider than maxWidth, and one more for each copy; an image sent again makes none. When the account's allowance of transformations runs out while making the copies, the image keeps those already made, and the next upload answers unavailable until there is allowance again. What that costs is on the pricing of Images and R2.
Your images on your site
The URLs of the assets are on the domain of your Hollware, which tells search engines not to index it. A site that wants its pictures indexed on its own domain serves them itself:
npx hollware export ./content --published --assets public/images/cms --assets-url /images/cms/ --url https://cms.example.com --token-file export.tokenThe token is a personal one with content:read: hollware token create --label export --scopes content:read --remote.
--assets writes each image the published entries show into that directory, as it is served, and every asset: reference in the export points at --assets-url instead. A static site builds from that export.
Without --assets, an export keeps the references as they are and writes the images, as they were uploaded, to _assets/ with an assets.json beside them. hollware import uploads them again before the entries that show them, so an export is a backup of your content and of its pictures. Videos and PDFs go with the images, in the export and in the daily backups.