Cloudinary's Upload API allows you to quickly upload your images, videos and other media files into your Cloudinary account for immediate deliverability. Let's show you how to use this API in your development environment.
This video is brought to you by Cloudinary's video player - embed your own!
This tutorial presents the following topics. Click a timestamp to jump to that part of the video.
|0:11||Our tutorial uses Node.js and server-side scripts to demonstrate the upload capabilities. However, we support many popular programming languages, including Ruby, PHP, Python and more.|
|0:32||Start writing a script that uses Cloudinary's Upload API to get the image into your account. Our example requires two different libraries - the Cloudinary Node.js SDK and dotenv, which allows your development environment to use your Cloudinary account credentials and upload the assets in an authenticated way.|
|0:50||Retrieve your environment variable from your Cloudinary account dashboard, then paste it into a .env file in your development project. Do not expose your Cloudinary account credentials in your site's frontend and public code.|
|1:14||Call the Cloudinary Upload API, then reference the file you want to upload.|
|1:19||Add your callback functions. This tutorial uses promises to handle the successes and failures in the code.|
|1:26||Make sure all of our script's libraries are properly installed with a simple
|1:41||You should have gotten a successful JSON response with lots of data about the uploaded file, including its resolution, file size, format, and more. The file is also now an immediately deliverable asset from a secure, HTTPS URL.|
|2:00||To upload a file from any public URL, simply enter the full URL of the asset, instead of the local file path.|
|2:19||You can edit the file's Public ID, so the asset is named exactly what you want it to be. It is also possible to add tags to the asset, so you can easily find and deliver it later. You can even apply quality analysis features to provide automation, based on the blurriness or overall size of the asset.|
- Download, clone or fork the tutorial's GitHub repository to follow along with the shown steps.
- Refer to the full Upload API reference for all the various parameters you can add to upload calls.
- Enroll in our introductory Cloudinary Academy courses that highlight the Node.js SDK, such as Fundamentals for Developers.
Check out 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.