All Topics
All Topics
Technology
Technology
AI
AI
Business
Business
Entertainment
Entertainment
News
News
Programming
Programming
Security
Security
Science
Science
Design
Design
Environment
Environment
Finance
Finance
Crypto
Crypto
Politics
Politics
Sports
Sports
Education
Education
Gaming
Gaming
Art
Art
Music
Music
Health
Health
Books
Books
Food
Food
Travel
Travel
Personal
Personal
Bluesky
Twitter

Cloudflare Images - Manage hosted images with the Images binding

25d ago

Source

CloudflareCloudflare Images - Manage hosted images with the Images bindingcloudflare.com
Snippet from the RSS feed
Use the Images binding to upload, list, retrieve, update, and delete images stored in Images directly from your Worker without managing API tokens or making HTTP requests. The env.IMAGES.hosted namespace supports the following storage and management operations: .upload(image, options) — Upload a new image to your account. .list(options) — List images with pagination. .image(imageId).details() — Get image metadata. .image(imageId).bytes() — Stream the original image bytes. .image(imageId).update(options) — Update metadata or access controls. .image(imageId).delete() — Delete an image. For example, you can upload an image from a request body and return its metadata: const image = await env . IMAGES . hosted . upload ( request . body , { filename : "upload.jpg" , metadata : { source : "worker" }, } ) ; return Response . json ( image ) ; Or retrieve and serve the original bytes of a hosted image: const bytes = await env . IMAGES . hosted . image ( "IMAGE_ID" ) . bytes () ; return new Response ( bytes ) ; For more information, refer to the Images binding .

You might also wanna read

Comments

Sign in to join the conversation.

No comments yet. Be the first.