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.
|
|
0:20 |
Upload presets let you add many parameters to your upload calls and use them all at once. |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
1:43 |
It may be helpful to clone the repo we've created for this demo. |
|
|
1:48 |
Make sure all of our script's libraries are properly installed with a simple npm i command. If you open your package.json file, you can see all of the packages have been listed as dependencies. |
|
|
|
|
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. |
|
|
2:36 |
Run node create-upload-preset.js to officially create our first upload preset! |
|
|
2:43 |
Upload the asset to Cloudinary with our newly created upload preset called winter-baby. |
|
|
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. |
|
|
4:04 |
Run create-derived-image-preset.js to create another upload preset! |
|
|
4:18 |
Upload the asset to Cloudinary with our newly created upload preset called profile-preset. |
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.