Upload images in Hono (video tutorial)
Last updated: Feb-19-2025
On this page:
Overview
Learn how to upload images to Cloudinary within a Hono application.
Video tutorial
This video is brought to you by Cloudinary's video player - embed your own!
Tutorial contents
This tutorial presents the following topics. Click a timestamp to jump to that part of the video.
Introduction to Hono and Cloudinary
Using Hono and Cloudinary together can give you a fast and secure way to upload assets at scale via an API. | |
Set up the upload route
Start in a Hono application and use middleware to set up your Cloudinary configuration. Then create a route for uploading an image: | |
Upload an image
Define the image as a file, then turn it into a byte array buffer. Encode it as base64 to upload to Cloudinary using Hono's encodeBase64 function, and use the Node.js SDK upload method to upload the data. Log the result of the upload to the console and return it to the API too. |
|
Test the image upload
Use a multipart form to test the image upload. See the JSON response and click the URL to see the image delivered from Cloudinary. You can also use the upload_stream method from the Node.js SDK. |
|
Keep learning
Related topics
- Check out our Node.js SDK for upload, transformations and more.
- Read our Upload guide to understand more about uploading to Cloudinary.
- See the Upload API reference for more methods and parameter explanations.
- Watch more Dev Hints videos on the Cloudinary YouTube channel.
If you like this, you might also like...
Check out the Cloudinary Academy for free self-paced Cloudinary courses on a variety of developer or DAM topics, or register for formal instructor-led courses, either virtual or on-site.
✖️