How to fix the `Upload preset not found` error in Cloudinary

I was doing a test project that used Cloudinary as the image storage.

I ran into this issue when I tried uploading the image. I received a 400 Bad Request with this JSON message:

{"error":{"message":"Upload preset not found"}}

Turned out I didn’t set up an Upload Preset.

You need to go in the Settings in your Cloudinary Dashboard, in the Upload tab you click “Add upload preset”, and you add one.

Then you use that preset name in your Cloudinary upload code.

For example I had a canvas object from an HTML canvas I wrote to, and this was the code to upload it to Cloudinary as an image:

const base64Image = canvas.toDataURL()
const formData = new FormData()
          formData.append('file', base64Image)
          formData.append('upload_preset', '***THE_PRESET_NAME***')

fetch(`https://api.cloudinary.com/v1_1/***YOUR_CLOUD_NAME***/image/upload`, {
  method: 'POST',
  body: formData,
})

Tip: while testing you might choose to add an unsigned upload preset, as it simplifies the code.


This content originally appeared on flaviocopes.com and was authored by flaviocopes.com

I was doing a test project that used Cloudinary as the image storage.

I ran into this issue when I tried uploading the image. I received a 400 Bad Request with this JSON message:

{"error":{"message":"Upload preset not found"}}

Turned out I didn’t set up an Upload Preset.

You need to go in the Settings in your Cloudinary Dashboard, in the Upload tab you click “Add upload preset”, and you add one.

Then you use that preset name in your Cloudinary upload code.

For example I had a canvas object from an HTML canvas I wrote to, and this was the code to upload it to Cloudinary as an image:

const base64Image = canvas.toDataURL()
const formData = new FormData()
          formData.append('file', base64Image)
          formData.append('upload_preset', '***THE_PRESET_NAME***')

fetch(`https://api.cloudinary.com/v1_1/***YOUR_CLOUD_NAME***/image/upload`, {
  method: 'POST',
  body: formData,
})

Tip: while testing you might choose to add an unsigned upload preset, as it simplifies the code.


This content originally appeared on flaviocopes.com and was authored by flaviocopes.com


Print Share Comment Cite Upload Translate Updates
APA

flaviocopes.com | Sciencx (2021-05-02T05:00:00+00:00) How to fix the `Upload preset not found` error in Cloudinary. Retrieved from https://www.scien.cx/2021/05/02/how-to-fix-the-upload-preset-not-found-error-in-cloudinary/

MLA
" » How to fix the `Upload preset not found` error in Cloudinary." flaviocopes.com | Sciencx - Sunday May 2, 2021, https://www.scien.cx/2021/05/02/how-to-fix-the-upload-preset-not-found-error-in-cloudinary/
HARVARD
flaviocopes.com | Sciencx Sunday May 2, 2021 » How to fix the `Upload preset not found` error in Cloudinary., viewed ,<https://www.scien.cx/2021/05/02/how-to-fix-the-upload-preset-not-found-error-in-cloudinary/>
VANCOUVER
flaviocopes.com | Sciencx - » How to fix the `Upload preset not found` error in Cloudinary. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/05/02/how-to-fix-the-upload-preset-not-found-error-in-cloudinary/
CHICAGO
" » How to fix the `Upload preset not found` error in Cloudinary." flaviocopes.com | Sciencx - Accessed . https://www.scien.cx/2021/05/02/how-to-fix-the-upload-preset-not-found-error-in-cloudinary/
IEEE
" » How to fix the `Upload preset not found` error in Cloudinary." flaviocopes.com | Sciencx [Online]. Available: https://www.scien.cx/2021/05/02/how-to-fix-the-upload-preset-not-found-error-in-cloudinary/. [Accessed: ]
rf:citation
» How to fix the `Upload preset not found` error in Cloudinary | flaviocopes.com | Sciencx | https://www.scien.cx/2021/05/02/how-to-fix-the-upload-preset-not-found-error-in-cloudinary/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.