Skip to main content

Cloudflare Images and Stream: media storage and delivery

Cloudflare · 29.09.2026

Why use Cloudflare Images and Stream

Cloudflare Images and Cloudflare Stream solve the same problem for different file types: instead of storing media on your own server, you serve it through the Cloudflare network with resizing, format conversion, and hotlink protection. Images handles pictures — product photos, avatars, screenshots. Stream handles video — from training clips to webinar recordings.

Both services fix an issue familiar to VPS owners on ZevsHost: the disk fills up with media files, and outbound traffic load grows with every visitor. Images and Stream move delivery to Cloudflare's edge servers, leaving only one original file on the origin.

How Cloudflare Images differs from Cloudflare Stream

The difference is not just the file type, but also how the final result is processed and delivered to the end user.

ParameterCloudflare ImagesCloudflare Stream
File typeJPEG, PNG, WebP, GIF, AVIFMP4, MOV, clips up to several hours long
ProcessingResize, crop, on-the-fly format changeTranscoding to HLS and DASH, multiple bitrates
DeliveryVia an image delivery URL with variantsVia an embeddable player or direct manifests

How to upload an image through the API

Create a token in the Dashboard under My Profile → API Tokens with Images:Edit permission. Uploading then takes one request:

curl -X POST \
  -F file=@photo.jpg \
  -H "Authorization: Bearer $CF_API_TOKEN" \
  https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/images/v1

The response contains the image ID and the base delivery URL. For bulk uploads of a product catalog, don't run curl by hand — set up automation instead, as described in the article on managing Cloudflare through the API and Terraform.

Image variants: resizing without reuploading the original

One uploaded original is served at different sizes through URL parameters, with no copies of the file created on disk:

  • width and height — target dimensions in pixels
  • fit — scale-down, contain, cover, crop, or pad
  • quality — a number from 1 to 100, affects file size
  • format — auto picks WebP or AVIF based on the browser's Accept header
  • sharpen — sharpness after resizing, a number from 0 to 10
https://imagedelivery.net/<account_hash>/<image_id>/w=800,quality=80,format=auto

When you need to add a watermark or sign the URL with a temporary token before handing out the link, that's done by a Cloudflare Worker placed in front of image delivery.

How to upload and deliver video through Stream

The same logic applies to video: one upload request, and Cloudflare prepares adaptive streams on its own.

curl -X POST \
  -H "Authorization: Bearer $CF_API_TOKEN" \
  -F file=@lesson.mp4 \
  https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/stream

After the upload, Stream splits the video into HLS and DASH segments and returns an ID for embedding the player. The clip is available in several bitrates right away, and the viewer's browser picks the one that fits the connection speed.

Limits and what to watch for

Before moving a media library over, check the service limits so you don't hit them after uploading hundreds of files:

  • maximum size of a single image — 10 MB
  • maximum length of a single Stream video — 6 hours
  • storage is billed separately from outbound traffic for views
  • private videos are locked down with signed URLs with a time limit

Summary: what to do before connecting

Images and Stream take the heaviest part of the job off the origin server — media delivery — without editing site code for every image size.

  1. create an API token with Images:Edit and Stream:Edit permissions
  2. define a set of resize variants matching the site layouts
  3. set up a watermark or signed URLs for private video
  4. check caching of the resulting URLs through Cache Rules
  5. compare with Cloudflare R2 if files need to be stored without processing
← Back to Knowledge Base Ask Support