Upload presets enable you to centrally define a set of asset upload options instead of specifying them in each upload call. You can define multiple upload presets and apply different presets in different upload scenarios.
Some use-cases for using upload presets include:
- Generating eager transformations for uploaded files. This is especially valuable for video transformations that may take longer to generate and helps to ensure your uploaded files will be ready for delivery.
- Applying incoming transformations while uploading a file, for example to limit format types or file size before storing uploaded files in your Cloudinary account.
- Applying add-on capabilities, such as auto-tagging to your uploads.
- Simplifying control and management of uploading files.
- Updating the behavior of user-generated content uploads without modifying the website or mobile app code.
- As upload preferences for uploads via the Upload widget.
From the Upload settings, you can also individually select signed upload presets that will act as the Default upload presets for images, videos, and raw files respectively. You can select one set of presets for API calls and another set for uploads via the Media Library. The settings in these default presets are applied to all uploads of the relevant asset type whenever no other preset is specified directly in an upload call or when uploading assets to the Media Library.
Each upload preset has a unique name. To apply an upload preset when uploading an asset, specify the preset name as the value of the
upload_preset parameter. For example, uploading the image
sample.jpg and specifying an upload preset named
let params = CLDUploadRequestParams() .setUploadPreset("my_image_preset") var mySig = MyFunction(params) // your own function that returns a signature generated on your backend params.setSignature(CLDSignature(signature: mySig.signature, timestamp: mySig.timestamp)) let request = cloudinary.createUploader().signedUpload( url: "sample.jpg", params: params)