/

How to Resolve the \"Upload preset not found\" Error in Cloudinary

How to Resolve the “Upload preset not found” Error in Cloudinary

If you’ve encountered the “Upload preset not found” error while using Cloudinary as your image storage solution, don’t worry! This issue can be easily fixed by following a few simple steps.

  1. Access Your Cloudinary Dashboard

    • Log in to your Cloudinary account and navigate to the Settings section.
  2. Add an Upload Preset

    • In the Settings area, locate the Upload tab and click on it.
    • Look for the “Add upload preset” button and click on it to create a new upload preset.
  3. Configure the Upload Preset

    • Provide a name for the upload preset. Make sure to choose a meaningful and descriptive name that represents its purpose.
    • Set any additional options or parameters as per your requirements.
  4. Use the Preset Name in Your Upload Code

    • Once you’ve created the upload preset, you’ll need to use its name in your Cloudinary upload code.
    • For example, if you have an HTML canvas object called canvas and want to upload it as an image to Cloudinary, you can use the following code snippet:
1
2
3
4
5
6
7
8
9
const base64Image = canvas.toDataURL()
const formData = new FormData()
formData.append('file', base64Image)
formData.append('upload_preset', 'YOUR_PRESET_NAME')

fetch(`https://api.cloudinary.com/v1_1/YOUR_CLOUD_NAME/image/upload`, {
method: 'POST',
body: formData,
})
  1. Consider Using an Unsigned Upload Preset for Testing
    • During testing and development, you may find it convenient to utilize an unsigned upload preset. This simplifies the process and reduces the need for additional authentication steps.

Following these steps should resolve the “Upload preset not found” error and allow you to successfully upload your images to Cloudinary.

tags: [“Cloudinary”, “Upload preset”, “Error”, “Image storage”, “Code snippet”]