Last updated: Nov-14-2022
On this page:
In this tutorial, we'll show you how to programmatically create and use Cloudinary's signed upload presets.
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.
What is an upload preset?
|0:20||Upload presets let you add many parameters to your upload calls and use them all at once.|
Some use cases
|0:31||With Cloudinary's APIs, you can create dozens of upload presets for different use cases, like: removing the background from an image, flagging a file for content moderation, or simply making sure your asset makes its way into the right folder. Check out more use cases in our Upload presets and Upload API documentation.|
Signed vs. unsigned presets
|0:46||At Cloudinary, presets can be signed or unsigned. Unsigned presets are used with unsigned upload calls. For example, when uploading directly from the browser on the frontend. In this tutorial we focus entirely on signed presets on the backend. You can find more information on the difference between signed and unsigned presets in our Upload presets documentation.|
Setting up development environment
|1:06||If this is your first time setting up your development environment with Cloudinary, we recommend watching our Upload Programmatically tutorial. It will also walk you through how to make your first upload.|
Clone the repository we use in this tutorial to follow along
|1:43||It may be helpful to clone the repo we've created for this demo.|
Ensure script libraries are installed
|1:48||Make sure all of our script's libraries are properly installed with a simple
Create a basic upload preset script
|1:59||Our first example script uses Cloudinary's Admin API to create a basic upload preset. We'll use that to upload an image to our product environment, with instructions on how to store it and actions to carry out as part of the upload process.|
Run script to create upload preset
Upload file with our preset
|2:43||Upload the asset to Cloudinary with our newly created upload preset called winter-baby.|
Create new preset with a simple transformation
|3:20||We apply the same techniques shown in the earlier example, but with transformations. This will transform the original file and only keep the transformed asset in our Cloudinary product environment.|
Run script to create another upload preset
Upload file with our preset
|4:18||Upload the asset to Cloudinary with our newly created upload preset called profile-preset.|
- Learn more about upload presets in the Media Upload guide.
- Dive deep into more options with upload presets in our Fundamentals for Developers course, such as eager and incoming transformations.
If you like this, you might also like...
Upload ProgrammaticallyUse a Cloudinary SDK to upload media assets
Media Library UploadDrag & drop or select from remote sources to upload
Upload with the CLIApply background removal to images on upload
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.